How should the Kha/Kinc Keyboard work? #1291
-
Hi! I'm trying to help improve the situation with Kha/Kinc keyboard across targets — I'm really interested in Android and Linux right now, and I knew nothing about low level keyboard input just a few weeks ago, and also I'm in my free time (like most, I suppose), so I can't promise anything really... but, the thing is that if I try, I will need some direction about how things should work. Take for example Kode/Kinc#480 — there it is stated:
Isn't that really a couple of misunderstood bugs? The Linux thing was clearly a bug, but to me it looks like the fix shouldn't be to make it behave like Windows, because it looks like a buggy behavior. If you just think about 2 + Shift it could kind of work... that @ thing is in the 2 physical key... But, what about some key like 4 in numerical keyboard/keypad? It is both the 4 (keypad 4, not the regular 4) and the left arrow (again, the keypad one, not the regular one), so just sending a keyDown/keyUp event with the main key (keypad 4 in this case) wouldn't allow client apps to know what is really happening — moreover because, generally speaking, keypad 4 is something you want to use with keyPress and the left key is something you want to use with keyUp/keyDown [1] . Also, the real Linux bug appears to me that was just a missing translation between The summary of this question would be: Is there a reference implementation today that other targets should follow? The Windows one, maybe? Bonus: Another thing will be Unicode input, but at least initial tests in some of my devices show that it is doable in Linux and Android, at least for basic Unicode (things like ł¶ŧ←↓→↑øþæßðđŋ). [1] I think that is related to armory3d/armortools#713 . |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Windows behavior looks correct to me. keyUp/Down are not for text input, that's what keyPress is for and that should also support unicode, at least in theory. |
Beta Was this translation helpful? Give feedback.
-
keyUp/keyDown are not supposed to take care of language specific keyboard layouts - unless you find an easy method to do that across all platforms and all languages. I don't even know how Asian keyboards work. |
Beta Was this translation helpful? Give feedback.
-
No, you should infer that we either put the time in to come up with a complete and consistent cross-platform and cross-language solution or just leave the code as it is. Otherwise we will just break existing code without really improving anything. |
Beta Was this translation helpful? Give feedback.
No, you should infer that we either put the time in to come up with a complete and consistent cross-platform and cross-language solution or just leave the code as it is. Otherwise we will just break existing code without really improving anything.