tohateam / hackerskeyboard

Automatically exported from code.google.com/p/hackerskeyboard
0 stars 1 forks source link

Alt key seems to set META_META_ON rather than META_ALT_ON in metaState #387

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I develop bVNC, aRDP, and aSPICE. I noticed that something may be wrong with 
the metaState that is set by Hacker's keyboard.

Q. What steps will reproduce the problem?

A. In a program that captures onKey(), print out the KeyEvent's that result 
from pressing ALT-F4 

What is the expected behavior?
KeyEvents with metaState=META_ALT_ON|META_ALT_LEFT_ON.

What do you see instead?
KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_ALT_LEFT, scanCode=0, 
metaState=META_META_ON|META_META_LEFT_ON, flags=0x0, repeatCount=0, 
eventTime=1386554071141, downTime=1386554071141, deviceId=-1, source=0x0 } 57

KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_F4, scanCode=0, 
metaState=META_META_ON|META_META_LEFT_ON, flags=0x0, repeatCount=0, 
eventTime=1386554071143, downTime=1386554071143, deviceId=-1, source=0x0 } 134

KeyEvent { action=ACTION_UP, keyCode=KEYCODE_F4, scanCode=0, 
metaState=META_META_ON|META_META_LEFT_ON, flags=0x0, repeatCount=0, 
eventTime=1386554071144, downTime=1386554071144, deviceId=-1, source=0x0 } 134

KeyEvent { action=ACTION_UP, keyCode=KEYCODE_ALT_LEFT, scanCode=0, 
metaState=META_META_ON|META_META_LEFT_ON, flags=0x0, repeatCount=0, 
eventTime=1386554071144, downTime=1386554071144, deviceId=-1, source=0x0 } 57

Q. What version of Hacker's Keyboard are you using? (See "Debug" section at
the bottom of the app's Settings menu.)

A. v1.33.1332

Q. On what phone or tablet?

A. Nexus 4

Q. If applicable, does this affect the 4-row or 5-row layout, or both? Which
language(s)?

A. I've tested English, and it affects both Portrait and Landscape.

Original issue reported on code.google.com by iiordanov@gmail.com on 9 Dec 2013 at 2:03

GoogleCodeExporter commented 9 years ago
Hi, I think I've fixed the issue with the attached patch. Please ensure my work 
is correct.

I used the values provided here:
    http://developer.android.com/reference/android/view/KeyEvent.html#META_ALT_ON
to calculate the correct value of KeyEvent.META_ALT_ON | 
KeyEvent.META_ALT_LEFT_ON to be 0x12.

The keyboard now produces expected metaState when Alt modifier is used.

Original comment by iiordanov@gmail.com on 9 Dec 2013 at 7:36

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the fix - can you try v1.34rc15 (or later) to see if that works for 
you? It also includes a Meta/Command/Windows key in the full 5-row layout.

https://code.google.com/p/hackerskeyboard/downloads/list

Original comment by Klaus.We...@gmail.com on 19 Dec 2013 at 11:53

GoogleCodeExporter commented 9 years ago
Please try 1.34rc17, earlier versions had inconsistent reporting of up/down 
events in multitouch mode.

This now mostly works for me in bVNC, except that the Alt key suppresses the 
modified key in multitouch mode. It works as expected in sticky key mode 
(touch+release Alt, then touch+release other key). According to my keytest app 
the right key events seem to be generated, is this possibly an issue in your 
app?

See also 
https://code.google.com/p/hackerskeyboard/downloads/detail?name=KeytestActivity-
debug.apk

Original comment by Klaus.We...@gmail.com on 20 Dec 2013 at 11:25

GoogleCodeExporter commented 9 years ago
With v1.34rc17, the keyboard no longer sets META_META_* instead of
META_ALT_*!

There is an "issue" with bVNC where I was ignoring left Alt because it is
used for symbol input on some hardware keyboards. I think this is causing
what you're reporting. If you want to test, configure Hacker's keyboard to
send right Alt key instead of left Alt key.

In any case, I now ignore left Alt only if the deviceID == 0 (which seems
to be the case for the default hardware keyboard on my G1 and G2 (yes, I
still keep those around for testing ;). So in the next release of bVNC
things should be pretty much seamless.

Thanks for your responsiveness and help in debugging!

Original comment by iiordanov@gmail.com on 21 Dec 2013 at 12:58

GoogleCodeExporter commented 9 years ago
The latest version of bVNC, v3.4.1, works perfectly for me with H's K. Please 
try it and let me know if you can confirm.

Thanks! 

Original comment by iiordanov@gmail.com on 21 Dec 2013 at 3:08

GoogleCodeExporter commented 9 years ago
I tested v1.34rc17 with bVNC on my HTC Dsire S.
Had not much time to check details, but the error I reported with ALT-F4 is 
gone.
THX a lot for fixing this issue.

Original comment by jasminje...@gmail.com on 22 Dec 2013 at 12:00

GoogleCodeExporter commented 9 years ago
[bulk bug update]

The changes from the 1.34rcX prerelease series are included in version 1.37 as 
published on the Play Store, and this bug should be fixed. If it's still not 
working for you, please reopen or file a new bug. Thanks to everyone who helped 
with finding bugs and testing!

Original comment by Klaus.We...@gmail.com on 26 Dec 2013 at 7:12