Glade Panel in Axis blocks arrow keys
- +Jan+
- Away
- Senior Member
-
Less
More
- Posts: 63
- Thank you received: 17
14 Oct 2021 10:46 #223070
by +Jan+
Replied by +Jan+ on topic Glade Panel in Axis blocks arrow keys
Attachments:
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
14 Oct 2021 15:57 #223093
by andypugh
Replied by andypugh on topic Glade Panel in Axis blocks arrow keys
Master has been converted to Pythin 3 and GTk3. This has changed the behaviour of a number of things.
I haven't used keyboard jogging for some time, but I do recall a Glade tab that used to annoyingly intercept keyboard events.
It's a hard puzzle to get right.
I haven't used keyboard jogging for some time, but I do recall a Glade tab that used to annoyingly intercept keyboard events.
It's a hard puzzle to get right.
Please Log in or Create an account to join the conversation.
- +Jan+
- Away
- Senior Member
-
Less
More
- Posts: 63
- Thank you received: 17
06 Nov 2021 20:34 #225525
by +Jan+
Replied by +Jan+ on topic Glade Panel in Axis blocks arrow keys
Thanks for the feedback, for now I'm back to using the good old stable pyvcp sidepanel, as using the gladepanel productively was too dangerous for me. If someone comes up with a solution in the future I'm still interested.
Best wishes
Jan
Best wishes
Jan
Please Log in or Create an account to join the conversation.
- moh
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 2
19 Nov 2021 11:06 #226968
by moh
Replied by moh on topic Glade Panel in Axis blocks arrow keys
I have the same issue for glade tabs.
I'm on 2.9, and whenever i jog and move the mouse pointer into a tab, the jog continues after releasing the jog button.
I'm a quite experienced programmer, but it seems difficult to get key forwarding working.
Does anyone have an idea on how to approach this issue in a way that will work?
I'm on 2.9, and whenever i jog and move the mouse pointer into a tab, the jog continues after releasing the jog button.
I'm a quite experienced programmer, but it seems difficult to get key forwarding working.
Does anyone have an idea on how to approach this issue in a way that will work?
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
21 Nov 2021 18:03 #227213
by andypugh
Replied by andypugh on topic Glade Panel in Axis blocks arrow keys
I think that your question is likely to get lost here in the Axis section of the forum.
Maybe try asking in the GladeVCP section?
FWIW I deciced that keyboard jogging was a bad idea a long time ago, partly for the sorts of reasons you are seeing. Jog-wheels and buttons connected in to the HAL layer are a lot more reliable.
Maybe try asking in the GladeVCP section?
FWIW I deciced that keyboard jogging was a bad idea a long time ago, partly for the sorts of reasons you are seeing. Jog-wheels and buttons connected in to the HAL layer are a lot more reliable.
Please Log in or Create an account to join the conversation.
- +Jan+
- Away
- Senior Member
-
Less
More
- Posts: 63
- Thank you received: 17
25 Oct 2026 20:33 - 25 Oct 2026 20:48 #350450
by +Jan+
Replied by +Jan+ on topic Glade Panel in Axis blocks arrow keys
Hello everyone,
after all these years, I finally seem to have found a solution to the problem described in this thread.
I should mention that I'm not really a programmer, so I investigated this with quite a bit of help from AI. Essentially, an amateur debugging LinuxCNC with AI assistance.
The original problem was that when jogging an axis using the arrow keys in AXIS, moving the mouse pointer into an embedded GladeVCP panel and releasing the key could cause the axis to continue moving.
I reproduced the issue in an isolated LinuxCNC 2.9.10 simulation and added some debugging output to AXIS and GladeVCP.It turned out that GladeVCP correctly receives the KeyRelease event, but the forwarded event does not always reach AXIS.
The solution appears to be surprisingly simple:
In lib/python/gladevcp/xembed.py, inside keyboard_forward()
add d.flush() immediately after fw.send_event(fe):
fw.send_event(fe) d.flush()
I performed an A/B/A test:
- With d.flush(): Jogging stops correctly.
- Without d.flush(): The original problem returns.
- With d.flush() restored: Jogging stops correctly again.
I also restored the original LinuxCNC 2.9.10 xembed.py and applied only this single-line modification. The fix still works.I tested repeated jogging and switching between axes, releasing the arrow keys while the mouse pointer was inside the GladeVCP panel. So far, the problem has not reappeared.
Please note: All testing was done in a simulation, not on a real machine. This is not a safety validation.Since I can`t guarantee that this is the correct upstream solution, it would be great if someone familiar with the XEmbed implementation could review the change.Maybe this little fix can finally put an end to an issue that has been around for quite a few years!
I attached the modyfied xembed.py file.
Best regards,
Jan
after all these years, I finally seem to have found a solution to the problem described in this thread.
I should mention that I'm not really a programmer, so I investigated this with quite a bit of help from AI. Essentially, an amateur debugging LinuxCNC with AI assistance.
The original problem was that when jogging an axis using the arrow keys in AXIS, moving the mouse pointer into an embedded GladeVCP panel and releasing the key could cause the axis to continue moving.
I reproduced the issue in an isolated LinuxCNC 2.9.10 simulation and added some debugging output to AXIS and GladeVCP.It turned out that GladeVCP correctly receives the KeyRelease event, but the forwarded event does not always reach AXIS.
The solution appears to be surprisingly simple:
In lib/python/gladevcp/xembed.py, inside keyboard_forward()
add d.flush() immediately after fw.send_event(fe):
fw.send_event(fe) d.flush()
I performed an A/B/A test:
- With d.flush(): Jogging stops correctly.
- Without d.flush(): The original problem returns.
- With d.flush() restored: Jogging stops correctly again.
I also restored the original LinuxCNC 2.9.10 xembed.py and applied only this single-line modification. The fix still works.I tested repeated jogging and switching between axes, releasing the arrow keys while the mouse pointer was inside the GladeVCP panel. So far, the problem has not reappeared.
Please note: All testing was done in a simulation, not on a real machine. This is not a safety validation.Since I can`t guarantee that this is the correct upstream solution, it would be great if someone familiar with the XEmbed implementation could review the change.Maybe this little fix can finally put an end to an issue that has been around for quite a few years!
I attached the modyfied xembed.py file.
Best regards,
Jan
Last edit: 25 Oct 2026 20:48 by +Jan+.
The following user(s) said Thank You: NWE
Please Log in or Create an account to join the conversation.
Time to create page: 0.089 seconds