Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile/event/key: wrong detection of key directions on Android #37374

Closed
hajimehoshi opened this issue Feb 22, 2020 · 1 comment
Closed

x/mobile/event/key: wrong detection of key directions on Android #37374

hajimehoshi opened this issue Feb 22, 2020 · 1 comment
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Milestone

Comments

@hajimehoshi
Copy link
Member

https://github.com/golang/mobile/blob/bceb7ef27cc623473a5b664d2a3450576dddff0f/app/android.go#L438-L445

C.AKeyEvent_getAction returns ACTION_DOWN (0) or ACTION_UP (1) (see https://developer.android.com/reference/android/view/KeyEvent#ACTION_DOWN), but this is compared with C.AKEY_STATE_DOWN (1) and C.AKEY_STATE_UP (0). As a result, keys' up/down states are reported in the opposite way.

CC @crawshaw

@gopherbot gopherbot added this to the Unreleased milestone Feb 22, 2020
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Feb 22, 2020
@gopherbot
Copy link

Change https://golang.org/cl/220538 mentions this issue: app: fix comparison of keys' direction

roderm pushed a commit to roderm/mobile that referenced this issue Sep 13, 2020
KeyEvent's getAction returns ACTION_DOWN (0), ACTION_UP (1) or
other values, and not AKEY_STATE_DOWN (1) or AKEY_STATE_UP (0).
This change fixes the wrong comparison.

Fixes golang/go#37374

Change-Id: Ia65ac881e57cc29d4bdde2365e177c2b4499a2d9
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/220538
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@golang golang locked and limited conversation to collaborators Feb 21, 2021
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
KeyEvent's getAction returns ACTION_DOWN (0), ACTION_UP (1) or
other values, and not AKEY_STATE_DOWN (1) or AKEY_STATE_UP (0).
This change fixes the wrong comparison.

Fixes golang/go#37374

Change-Id: Ia65ac881e57cc29d4bdde2365e177c2b4499a2d9
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/220538
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
KeyEvent's getAction returns ACTION_DOWN (0), ACTION_UP (1) or
other values, and not AKEY_STATE_DOWN (1) or AKEY_STATE_UP (0).
This change fixes the wrong comparison.

Fixes golang/go#37374

Change-Id: Ia65ac881e57cc29d4bdde2365e177c2b4499a2d9
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/220538
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

2 participants