Description
bug in to_linux_keycode: the total occupation of a map is considered as the size (#elements).
The following patch fixes this:
diff -r 73e79f23096b modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c
--- a/modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c Sun Jun 29 14:37:50 2014 +0300
+++ b/modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c Mon Jun 30 15:57:49 2014 +0200
@@ -63,7 +63,8 @@
}
int to_linux_keycode(int androidKeyCode) {
- for (int i = 0; i < sizeof (keyMap); ++i) {
+ int keySize = sizeof(keyMap)/sizeof(keyMap[0]);
+ for (int i = 0; i < keySize; ++i) {
if (keyMap[i].androidKC == androidKeyCode) {
return keyMap[i].linuxKC;
}
The following patch fixes this:
diff -r 73e79f23096b modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c
--- a/modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c Sun Jun 29 14:37:50 2014 +0300
+++ b/modules/graphics/src/main/native-glass/lens/dalvik/dalvikUtils.c Mon Jun 30 15:57:49 2014 +0200
@@ -63,7 +63,8 @@
}
int to_linux_keycode(int androidKeyCode) {
- for (int i = 0; i < sizeof (keyMap); ++i) {
+ int keySize = sizeof(keyMap)/sizeof(keyMap[0]);
+ for (int i = 0; i < keySize; ++i) {
if (keyMap[i].androidKC == androidKeyCode) {
return keyMap[i].linuxKC;
}