Keybinding help
13 Dec 2015 04:33 #66919
by Shalotek
Keybinding help was created by Shalotek
I have been struggling to find the info for the past week I am tired of reading posts and getting nowhere so i am asking for help
I would like to know how to add a key either in axis and gscreen or gmoccapy
i am making a arduino leonardo pendant to send keystrokes it works fine but i would like added functionality ie
in axis i would like to be able to bind keys to for feed override not jog feed
in gscreen or gmoccapy feed override and select jogmode
I really need simple examples because i am still struggling with linux i can reverse engineer pretty good if i have something to work with but i have not been able to find anything that explains what i want to know
here is a sample from pico USC so maybe i am making sense (ignore that i am asking about a limit switch i would just like to know how to link to a keystroke)
# connect limit/home switch outputs to motion controller
newsig Xminlim bit
newsig Xmaxlim bit
newsig Xhome bit
linksp Xminlim <= ppmc.0.din.01.in (its an example but how would i link a signal like this to a KEYSTROKE)
linksp Xminlim => axis.0.neg-lim-sw-in
linksp Xmaxlim <= ppmc.0.din.02.in
linksp Xmaxlim => axis.0.pos-lim-sw-in
linksp Xhome <= ppmc.0.din.00.in
linksp Xhome => axis.0.home-sw-in
Matthew
I would like to know how to add a key either in axis and gscreen or gmoccapy
i am making a arduino leonardo pendant to send keystrokes it works fine but i would like added functionality ie
in axis i would like to be able to bind keys to for feed override not jog feed
in gscreen or gmoccapy feed override and select jogmode
I really need simple examples because i am still struggling with linux i can reverse engineer pretty good if i have something to work with but i have not been able to find anything that explains what i want to know
here is a sample from pico USC so maybe i am making sense (ignore that i am asking about a limit switch i would just like to know how to link to a keystroke)
# connect limit/home switch outputs to motion controller
newsig Xminlim bit
newsig Xmaxlim bit
newsig Xhome bit
linksp Xminlim <= ppmc.0.din.01.in (its an example but how would i link a signal like this to a KEYSTROKE)
linksp Xminlim => axis.0.neg-lim-sw-in
linksp Xmaxlim <= ppmc.0.din.02.in
linksp Xmaxlim => axis.0.pos-lim-sw-in
linksp Xhome <= ppmc.0.din.00.in
linksp Xhome => axis.0.home-sw-in
Matthew
Please Log in or Create an account to join the conversation.
13 Dec 2015 23:20 #66932
by BigJohnT
Replied by BigJohnT on topic Keybinding help
Please Log in or Create an account to join the conversation.
14 Dec 2015 02:37 #66942
by Shalotek
Replied by Shalotek on topic Keybinding help
Ty John
i have read this and finally figured out a bit of it but it is still very confusing
lets say i want ti remove the key-binds for all axis and just use the - and= for jogging that's easy
but if i want to bind feed override to [ and ] well i cant find the list of commands so i know what to add
everything i have tried i get a Tcl error when i start linuxcnc
i have read this and finally figured out a bit of it but it is still very confusing
lets say i want ti remove the key-binds for all axis and just use the - and= for jogging that's easy
but if i want to bind feed override to [ and ] well i cant find the list of commands so i know what to add
everything i have tried i get a Tcl error when i start linuxcnc
Please Log in or Create an account to join the conversation.
14 Dec 2015 11:42 #66951
by BigJohnT
Replied by BigJohnT on topic Keybinding help
Hopefully the author of that will chime in, I just knew where it was.
JT
JT
Please Log in or Create an account to join the conversation.
14 Dec 2015 13:37 - 14 Dec 2015 13:38 #66956
by Shalotek
Replied by Shalotek on topic Keybinding help
well i got everything working except for one thing now, that is the feed override in axis there are keybinds for Jog speed and angular jog speed in usr/bin/axis under help1 ( , .) jog (<>)ang jog however i cannot find anyway to change these I thought if i could then i could add the code needed to bind the feed override the same as they are
for a little more clarification when i am not using my pendant for jogging i want to turn the wheel to control the feed override
I want the pendant to work as a keyboard not as a hal component that is hard wired
any suggestions?
note(1) I also checked the file usr/share/axis/axis.tcl and didnt find the jog slider keybinds
for a little more clarification when i am not using my pendant for jogging i want to turn the wheel to control the feed override
I want the pendant to work as a keyboard not as a hal component that is hard wired
any suggestions?
note(1) I also checked the file usr/share/axis/axis.tcl and didnt find the jog slider keybinds
Last edit: 14 Dec 2015 13:38 by Shalotek.
Please Log in or Create an account to join the conversation.
14 Dec 2015 15:01 #66961
by andypugh
Doing this via a key-binding is unlikely to be the best way.
Key-bindings run the risk of sending the key-press event to the wrong window of the LinuxCNC GUI, or to the wrong application altogether.
(For example, you can't keyboard-jog if the mouse pointer is over a GladeVCP tab).
Also, there is no guarantee of a timely response to a GUI keystroke.
Worst case, you send a keydown command, start a jog, move the mouse, release the key and the KeyUp event goes to a different application and the jog doesn't stop.
The things that it sounds like you want to do are better done with HAL pins.
linuxcnc.org/docs/2.7/html/man/man1/halui.1.html
Replied by andypugh on topic Keybinding help
i am making a arduino leonardo pendant to send keystrokes it works fine but i would like added functionality ie
in axis i would like to be able to bind keys to for feed override not jog feed
Doing this via a key-binding is unlikely to be the best way.
Key-bindings run the risk of sending the key-press event to the wrong window of the LinuxCNC GUI, or to the wrong application altogether.
(For example, you can't keyboard-jog if the mouse pointer is over a GladeVCP tab).
Also, there is no guarantee of a timely response to a GUI keystroke.
Worst case, you send a keydown command, start a jog, move the mouse, release the key and the KeyUp event goes to a different application and the jog doesn't stop.
The things that it sounds like you want to do are better done with HAL pins.
linuxcnc.org/docs/2.7/html/man/man1/halui.1.html
Please Log in or Create an account to join the conversation.
14 Dec 2015 16:23 #66971
by Shalotek
Replied by Shalotek on topic Keybinding help
While I understand what you are saying with the hal pins that's not the way I wanna do it lol
There are already keybinds for what I want except feed override so it shouldn't be a problem to add two keys to control that from my jog wheel I just need to know where the code is that controls the jog feed slider so I can implement the feed override keybinds
There are already keybinds for what I want except feed override so it shouldn't be a problem to add two keys to control that from my jog wheel I just need to know where the code is that controls the jog feed slider so I can implement the feed override keybinds
Please Log in or Create an account to join the conversation.
14 Dec 2015 17:00 #66975
by andypugh
Replied by andypugh on topic Keybinding help
Don't complain when it all goes horribly wrong, then....While I understand what you are saying with the hal pins that's not the way I wanna do it lol
Actually, feed override is mapped to the 1 to 0 keys, with 0 being 100%There are already keybinds for what I want except feed override
Please Log in or Create an account to join the conversation.
14 Dec 2015 17:22 - 15 Dec 2015 02:43 #66976
by Shalotek
Replied by Shalotek on topic Keybinding help
Yes but I want to control it incrementally like the other feed overrides at 1% increments
EDIT*
in filesystem/usr/share/axis/tcl i found axis.tcl
this is for Angular jog
frame ${pane_top}.ajogspeed
label ${pane_top}.ajogspeed.l0 -text [_ "Jog Speed:"]
label ${pane_top}.ajogspeed.l1
scale ${pane_top}.ajogspeed.s -bigincrement 0 -from .06 -to 1 -resolution .020 -showvalue 0 -variable ajog_slider_val -command update_ajog_slider_vel -orient h -takefocus 0
label ${pane_top}.ajogspeed.l -textv jog_aspeed -width 6 -anchor e
pack ${pane_top}.ajogspeed.l0 -side left
pack ${pane_top}.ajogspeed.l -side left
pack ${pane_top}.ajogspeed.l1 -side left
pack ${pane_top}.ajogspeed.s -side right
bind . <less> [regsub %W [bind Scale <Left>] ${pane_top}.ajogspeed.s] #this line
bind . <greater> [regsub %W [bind Scale <Right>] ${pane_top}.ajogspeed.s] #and this line
I took those two lines and added them to the feed override below changed the keybinds and the scale name problem solved
i will post the details later once i get the arduino code wrote and all tested untill then i hope this helps someone
EDIT*
in filesystem/usr/share/axis/tcl i found axis.tcl
this is for Angular jog
frame ${pane_top}.ajogspeed
label ${pane_top}.ajogspeed.l0 -text [_ "Jog Speed:"]
label ${pane_top}.ajogspeed.l1
scale ${pane_top}.ajogspeed.s -bigincrement 0 -from .06 -to 1 -resolution .020 -showvalue 0 -variable ajog_slider_val -command update_ajog_slider_vel -orient h -takefocus 0
label ${pane_top}.ajogspeed.l -textv jog_aspeed -width 6 -anchor e
pack ${pane_top}.ajogspeed.l0 -side left
pack ${pane_top}.ajogspeed.l -side left
pack ${pane_top}.ajogspeed.l1 -side left
pack ${pane_top}.ajogspeed.s -side right
bind . <less> [regsub %W [bind Scale <Left>] ${pane_top}.ajogspeed.s] #this line
bind . <greater> [regsub %W [bind Scale <Right>] ${pane_top}.ajogspeed.s] #and this line
I took those two lines and added them to the feed override below changed the keybinds and the scale name problem solved
i will post the details later once i get the arduino code wrote and all tested untill then i hope this helps someone
Last edit: 15 Dec 2015 02:43 by Shalotek.
Please Log in or Create an account to join the conversation.
Time to create page: 0.101 seconds