-
Notifications
You must be signed in to change notification settings - Fork 64
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
[Android] Idea for handle_input() in CNFGEGLDriver.c #67
Comments
Hey! I'm sorry I haven't been able to get back to this. I'm not exactly sure of the right solution here, but I would love to have this solved. Do you see any downsides with adding this? I guess I'm not sure which situations it won't get input. It's not like we could detect a down and up input both anyway, right? |
Hi, yes there might be an issue with physical keyboards. I can try asking around if I can borrow a bluetooth keyboard somewhere. Or do you have one? But I also now realize that in the current code the order in which the two bDown are sent determines whether the keycode was from a unicode conversion or not. When the key doesn't have a unicode equivalent the order of the But I do think it's a bit cumbersome to work with that. With both up and down inputs do you mean with a modifier? I tried a lot of combinations, but it seems to be either
(Hacker Keyboard does this. Same for CTRL + key or pressing for instance tilde directly) or
(GBoard does this) BTW I'm currently making a todo / shopping list: |
I do have a USB keyboard and otg adapter, hut not sure what I'd need to do |
Can you add this line to CNFGEGLDriver.c:
I suppose you don't need Then with (example hacker keyboard)
(example GBoard)
or a lower case a (like Windows and Linux):
And either way, I'll try whether the current method is sufficient and works for what I can test. So it will use a buffer that says to ignore the next keycode/bDown pair. |
Using a buffer which ignores duplicate keys on Android seems to work all right. But the solution is a bit quirky and I suppose it is what an app is required to do if it wants text entry. Here is the code I used. NB it uses an
|
This looks good to me - if you are interested in committing it. One question, though. How is ignore_buffer populated? It looks like it would corrupt the static area. @Procyon3 |
Hello,
When you press shift on for instance the GBoard virtual keyboard, it inserts a semicolon.
Looking at CNFGEGLDriver.c, it's because:
code
74 andunicode
59.code
59 andunicode
0.In both cases HandleKey receives 59.
Another conflict I found is with 'C' and backspace. Hacker Keyboard shows there's technically more, but they aren't used on Android (e.g. home/end, pgup/pgdn, alt + key, ctrl + key, num lock, scroll lock).
Defining ANDROID_USE_SCANCODES loses the information in
event
and gets too messy with having to maintain the state of the keyboard yourself. For instance Hacker Keyboard has Caps Lock if you press shift twice (so the graphics are all Caps), but GBoard does not.I'd like to propose that handle_input() did
Because it looks like bDown isn't useful at all with a virtual keyboard. It always sends a two events with a 0 and then a 1 for bDown.
Or that handle_input() added exceptions for these conflicts (at least for shift and backspace).
The text was updated successfully, but these errors were encountered: