Glade Panel in Axis blocks arrow keys

More
5 years 2 weeks ago #223070 by +Jan+
Here is the single file attached.

Attachment not found

Please Log in to join the conversation.

More
5 years 2 weeks ago #223093 by andypugh
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.

Please Log in to join the conversation.

More
4 years 11 months ago #225525 by +Jan+
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

Please Log in to join the conversation.

More
4 years 11 months ago #226968 by moh
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?

Please Log in to join the conversation.

More
4 years 11 months ago #227213 by andypugh
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.

Please Log in to join the conversation.

More
5 days 13 hours ago #350450 by +Jan+
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

Please Log in to join the conversation.

Time to create page: 0.044 seconds
Powered by Kunena Forum