Glade Panel in Axis blocks arrow keys

More
8 years 9 months ago #105171 by cmorley
I would put a print statement just before the ignore test and just before send_event to see if the keypress/release are being detected but just not fowarded.
Code:
def forward(w, e, fw): print 'key detected' if e.keyval in ignore: return g = fw.get_geometry() fe = gtk2xlib(e, fw, g) if not fe: return print 'event forwarded' fw.send_event(fe)

If that is true then you could probably fix this problem by forwarding releases explicitly when linuxcnc is actively jogging.
One could use the python linuxcnc library for this.

But adding the print statements and doing your tests again would be the first step.

Chris M

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #105179 by +Jan+
Hello Chris,
here is the result:



The detection seems to work.

If that is true then you could probably fix this problem by forwarding releases explicitly when linuxcnc is actively jogging.
One could use the python linuxcnc library for this.


I`m only good in copy and paste, so I would need some help for this :(

Thanks in advance

Jan

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago - 8 years 9 months ago #105180 by Grotius
@Jan,

I read your problem also.

Is there a way to avoid this dangerous behaviour?


I think you can fix this in glade, in your side panel behavior you can do that i think. In glade look at common / events for example.
I don't know all the item's, but i think it is possible in glade.
In the time of the Axis program design, the programmer's where thinking other way's.
So i think that's why this can happen.
Last edit: 8 years 9 months ago by Grotius.

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #105184 by cmorley
you can not fix this from the glade editor.

I'll see if I can piece something together for you to try.

Chris M

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #105185 by cmorley
First try this, replace the def forward function etc with this code:
Code:
def forward_press(w, e, fw): if e.keyval in ignore: return g = fw.get_geometry() fe = gtk2xlib(e, fw, g) if not fe: return fw.send_event(fe) def forward_release(w, e, fw): g = fw.get_geometry() fe = gtk2xlib(e, fw, g) if not fe: return fw.send_event(fe) window.connect_after("key-press-event", forward_press, fw) window.connect("key-release-event", forward_release, fw)

Now that will only ignore press events not release events.

Chris M

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #105186 by cmorley
hmm i see press events use 'connect_after' and release uses 'connect'
changing those commands could make a difference too.

Chris M

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum