GladeVCP and Keyboard.

More
04 Apr 2013 06:33 #32250 by Connor9220
How do you bind a key to a widget? I'm working with the hal_combobox. I want to be able to cycle through the options with one (or two if needed) keystorkes. Additionally, how do I tie the output value to a hal pin?

I'm using this to make a unit selector for the external jog wheel. I've got the XYZ buttons working now.. this the last thing I need.

Thanks, Connor

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

More
04 Apr 2013 11:18 #32259 by cmorley
Replied by cmorley on topic GladeVCP and Keyboard.
Please explain how you want the key bindings to work.
Doesn't the up down keys work on it after selecting the combobox?

www.linuxcnc.org/docs/2.5/html/gui/glade...ladevcp:HAL_ComboBox

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

More
04 Apr 2013 12:01 #32261 by Connor9220
Replied by Connor9220 on topic GladeVCP and Keyboard.
Yes, Up/Down work if it's selected. I'm talking about quick key or hot key or whatever you want to call it. a key that I can use on the keyboard to operate the up/down without having to select the combo. Like the one in Axis. You can change the value by hitting the i key, or shift i to go back up.

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

More
04 Apr 2013 12:18 #32262 by cmorley
Replied by cmorley on topic GladeVCP and Keyboard.
Ok GTK calls the widget accelerators.
I think his would require you to add python code to a gladeVCP handler file - gladeVCP knows nothing of accelerators.

www.pygtk.org/pygtk2tutorial/sec-WidgetAccelerators.html

The accelerator emits the signal that controls the widget
You have to attach an accelerator group to a top level window then attach an accelerator to a widget you want to control.
That may be a problem since when you embed gladeVCP into AXIS the toplevel widget is replaced and destroyed.
I don't know a lot more about this as I just read about them now and tried a button example example in Gscreen.

Hmm just looking in the GLADE editor of a combo box under common:
there is a entry for accelerator key selection - you could try that.
I don't have time to try it right now.

Chris M

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

More
04 Apr 2013 23:26 #32278 by Connor9220
Replied by Connor9220 on topic GladeVCP and Keyboard.
I've tried using the accelerator on the combo box under common already.. I think Axis is intercepting the key stroke request maybe? or like you said, not able to attach it to ta top level window since it' embedded with AXIS. Wonder if you could add some code to the .axisrc file and have it relay to the widget ?

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

Moderators: mhaberlerHansU
Time to create page: 0.101 seconds
Powered by Kunena Forum