-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
Missing GDK key definitions #2220
Comments
can i get a screenshot of your code please to know which code giving this error exactly. |
Sure; this'll cause the error. import toga
class HelloWorld(toga.App):
def startup(self):
"""Construct and show the Toga application."""
main_box = toga.Box()
main_box.add(toga.TextInput())
self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = main_box
self.main_window.show()
def main():
return HelloWorld() |
A technical question, has this issue actually been completed in its entirety? The PR seems from the description to be focused on numpad keys, I can't test those as I don't have a physical num-block, but combinations involving Ctrl, Shift and Alt on TextInput still produce errors for me. Try pressing things like Shift+Tab, Ctrl+Tab, Alt+F4, alt+Tab, output is the same as the original bug report. Thanks! |
@RastislavKish There's also a bunch of key improvements in #2415, so the fixes aren't entirely part of #2232. The issue reported by this ticket appears to be resolved in my testing (i.e., numpad keys, plus the use of modifiers); I definitely don't see the issue related to this specific ticket (i.e., seeing a KeyError) with Tab keys. However, if I missed some keys in my testing, or if there are key combinations that aren't working, then feel free to open a specific bug report with the keys/combos that aren't working. Regarding Tab specifically - that's going to be a complex one, because CMD-tab/ALT-tab are often OS-level commands for task or app switching, so it might not be possible to support those in a generic way. The same goes for some function keys. At the very least, it's probably worth flagging this in the docs for commands. |
@freakboy3742 the keyboard combinations are in-fact working functionally, i.e. pressing Shift+Tab moves the cursor, Alt+F4 closes the focused window etc. it's just that errors are thrown in the terminal, even if from the user's perspective, everything works as expected. Which distro are you using for testing purposes? I can see the original post reported pop os, maybe it's some Ubuntu GTK packaging oddity, I can try to reproduce this elsewhere and open a separate issue then. |
I do most of my Linux testing on Ubuntu 22.04 LTS. |
I'm seeing the same thing. The keys are functioning but throw an error on the terminal.
I noticed the errors while working through the BeeWare Tutorial 2. |
@28Candler62 Are you seeing this on the main branch of Toga, or the most recent 0.4.2 release? The changes from #2232 have been merged, but aren't in a published release at this time. |
@freakboy3742 |
Same issue. KeyError: 65505 |
@jbesq-ml ... and the same question: Are you running Toga's main branch, or Toga 0.4.2? If you're running 0.4.2, that version does not include the fix for this problem. |
To confirm, there are still missing keys on 65505 - L SHIFT as a few examples. Toga version: Full list perhaps: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/gdkkeysyms.h |
SHIFT and RSHIFT shouldn't be generating keystrokes at all - shift should be treated as a modifier. I've tried running a GTK app, and I don't get any warnings for SHIFT keypresses; how are you getting a keycode generated for a SHIFT? LEFT TAB should be caught as a modifier; if it's not being caught by "SHIFT + TAB", then clearly it needs special handling. In my testing. TAB and LEFT TAB are both bound to focus changes, so they're probably in the territory of "thing that should be platform-prohibited (or at least warned) as key bindings. The other two are missing as a consequence of using an Apple keyboard that doesn't have those two keys :-) Fix incoming shortly. |
I'm not sure....but basically any way I start the app, I can trigger the warnings. Furthermore, though, it happens for left and right CTRL, ALT, and SUPER. Some other missing keys i just found:
|
I think, though, I can only trigger these errors when the cursor is in a textbox. If a button, for example, has focus, the warnings aren't logged. |
Yeah - I eventually worked that bit out. #2553 should fill the gaps you've identified, including silencing the bare shift warning on GTK. |
Describe the bug
Several keys are throwing the error below:
Affected keys:
left shift: 0xFFE1
left ctrl: 0xFFE3
left alt: 0xFFE9
right shift: 0xFFE2
right alt: 0xFFEA
right super: 0xFFEC
right context: 0xFF67
right ctrl: 0xFFE4
insert: 0xFF63
...as well as the entire numpad (whether or not numlock is enabled)
Steps to reproduce
Use the number pad in a
TextInput
using GTK.Expected behavior
The keys are mapped correctly.
Screenshots
No response
Environment
0.3.17.dev54+g39040475.d20231112
0.4.1.dev19+g69fc00cb5
Logs
briefcase.2023_11_11-20_21_13.dev.log
Additional context
No response
The text was updated successfully, but these errors were encountered: