Key binding

More
23 Mar 2022 08:48 #238084 by daiman444
Key binding was created by daiman444
hello colleagues. can someone suggest or share code example how to make hotkeys for gmoccappy ?

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

More
23 Mar 2022 13:45 - 23 Mar 2022 13:46 #238102 by newbynobi
Replied by newbynobi on topic Key binding
It is done in
linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py

look for
def on_key_event(self, widget, event, signal):
 
around line 2936

Norbert
Last edit: 23 Mar 2022 13:46 by newbynobi.

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

More
14 Apr 2022 09:32 #240223 by mariusl
Replied by mariusl on topic Key binding
Thanks Norbert. I was just going to ask the question.

Regards
Marius


www.bluearccnc.com

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

More
16 Apr 2022 06:43 #240376 by mariusl
Replied by mariusl on topic Key binding
For interest sake.
At about line 3077 you can add these lines to add keys for the A axis.

        elif keyname == "Page_Down" or keyname == "KP_Page_Down":
            button_name = "z-"
            if signal:
                self._on_btn_jog_pressed(None, button_name, fast)
            else:
                self._on_btn_jog_released(None, button_name)
        elif keyname == "Home" or keyname == "KP_Home":
            button_name = "a+"
            if signal:
                self._on_btn_jog_pressed(None, button_name, fast) 
            else:
                self._on_btn_jog_released(None, button_name)        
        elif keyname == "End" or keyname == "KP_End":
            button_name = "a-"
            if signal:
                self._on_btn_jog_pressed(None, button_name, fast)
            else:
                self._on_btn_jog_released(None, button_name)     
       
 

Regards
Marius


www.bluearccnc.com

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

Moderators: newbynobi
Time to create page: 0.062 seconds
Powered by Kunena Forum