openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.97k stars 2.55k forks source link

Android keyPressed for volume buttons always sets key = 0 #2418

Open nneonneo opened 11 years ago

nneonneo commented 11 years ago

When a keyPressed event is received for pressing a menu button, the key passed in is always 0. This is because event.getUnicodeChar() returns 0 for keys that are not used to type characters, which includes most of the physical keys on a typical touchscreen-based Android phone.

One solution would be to have the Android wrapper define some "special" keys (negative numbers to avoid conflicting with Unicode codepoints? numbers with a high-ish bit, like bit 28, set?), and pass those in when the key is special (volume, home, menu, etc).

bilderbuchi commented 11 years ago

hm, I could swear this issue was already reported (as #2415), but that issue is gone/disappeared! What's going on?

nneonneo commented 11 years ago

Yeah, sorry, that was me. I posted it from the wrong account and had the issue deleted.

Robert

在 2013-8-6,16:22,Christoph Buchner notifications@github.com 写道:

hm, I could swear this issue was already reported (as #2415), but that issue is gone/disappeared! What's going on?

— Reply to this email directly or view it on GitHubhttps://github.com/openframeworks/openFrameworks/issues/2418#issuecomment-22162563 .

bilderbuchi commented 11 years ago

I see, thanks.