Keyboard Shortcuts in Gmoccapy
- abdulasis12
- Offline
- Premium Member
-
Less
More
- Posts: 131
- Thank you received: 8
18 May 2024 14:45 #300915
by abdulasis12
Replied by abdulasis12 on topic Keyboard Shortcuts in Gmoccapy
Hi ,
I try use : loadusr -W hal_input -K +KeyWarrior:0
in my hall, but debug file pop-up
***
Note: Using POSIX realtime
HAL: ERROR: duplicate component name 'iocontrol'
IOCONTROL: ERROR: hal_init() failed
can't initialize the HAL
Waiting for component 'hm2_eth' to become ready.....................
No input devices could be opened. This usually indicates a misconfigured
system. Please read the section 'PERMISSIONS AND UDEV' in the hal_input
manpage
./217-4x.hal:26: waitpid failed hal_input hal_input
./217-4x.hal:26: hal_input exited without becoming ready
1233
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
*
hal_input <<
how to access permission. ?
or more other file to setup before use ?
FYI:
in hall line 26 is : loadusr -W hal_input -K +KeyWarrior:0
Thank you,
Asis
I try use : loadusr -W hal_input -K +KeyWarrior:0
in my hall, but debug file pop-up
***
Note: Using POSIX realtime
HAL: ERROR: duplicate component name 'iocontrol'
IOCONTROL: ERROR: hal_init() failed
can't initialize the HAL
Waiting for component 'hm2_eth' to become ready.....................
No input devices could be opened. This usually indicates a misconfigured
system. Please read the section 'PERMISSIONS AND UDEV' in the hal_input
manpage
./217-4x.hal:26: waitpid failed hal_input hal_input
./217-4x.hal:26: hal_input exited without becoming ready
1233
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime
*
hal_input <<
how to access permission. ?
or more other file to setup before use ?
FYI:
in hall line 26 is : loadusr -W hal_input -K +KeyWarrior:0
Thank you,
Asis
Please Log in or Create an account to join the conversation.
- HansU
-
- Offline
- Moderator
-
Less
More
- Posts: 678
- Thank you received: 203
18 May 2024 19:09 #300930
by HansU
Replied by HansU on topic Keyboard Shortcuts in Gmoccapy
A similar problem was reported here. Maybe Andys suggestion does help you?
forum.linuxcnc.org/24-hal-components/507...nnected-to-it#286170
forum.linuxcnc.org/24-hal-components/507...nnected-to-it#286170
The following user(s) said Thank You: abdulasis12
Please Log in or Create an account to join the conversation.
- abdulasis12
- Offline
- Premium Member
-
Less
More
- Posts: 131
- Thank you received: 8
21 May 2024 06:09 - 21 May 2024 07:09 #301054
by abdulasis12
Replied by abdulasis12 on topic Keyboard Shortcuts in Gmoccapy
Thank you for reply MR. HansU
I try with your link of MR.andypugh .
I: Bus=0003 Vendor=1a2c Product=2124 Version=0110
N: Name="SEM USB Keyboard"
P: Phys=usb-0000:00:14.0-4/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/0003:1A2C:2124.0001/input/input5
U: Uniq= H: Handlers=sysrq kbd leds event5
B: PROP=0 B: EV=120013
B: KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe
B: MSC=10 B: LED=7
I create file on /etc/udev/rules.d/
ATTR{idProduct}=="1a2c", ATTR{idVendor}=="2124", MODE="0660", GROUP="asis" #(I already create group name: asis )
I save, and reboot 1 time
When run linuxcnc , not work , just :hal:27: hal_input exited without becoming ready
Have any more for me set-up ?
Thankyou,
Asis
I try with your link of MR.andypugh .
I: Bus=0003 Vendor=1a2c Product=2124 Version=0110
N: Name="SEM USB Keyboard"
P: Phys=usb-0000:00:14.0-4/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/0003:1A2C:2124.0001/input/input5
U: Uniq= H: Handlers=sysrq kbd leds event5
B: PROP=0 B: EV=120013
B: KEY=1000000000007 ff800000000007ff febeffdff3cfffff fffffffffffffffe
B: MSC=10 B: LED=7
I create file on /etc/udev/rules.d/
ATTR{idProduct}=="1a2c", ATTR{idVendor}=="2124", MODE="0660", GROUP="asis" #(I already create group name: asis )
I save, and reboot 1 time
When run linuxcnc , not work , just :hal:27: hal_input exited without becoming ready
Have any more for me set-up ?
Thankyou,
Asis
Attachments:
Last edit: 21 May 2024 07:09 by abdulasis12.
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4251
- Thank you received: 1873
21 May 2024 07:16 #301058
by Aciera
Replied by Aciera on topic Keyboard Shortcuts in Gmoccapy
Not sure if this is related but you seem to have a preceding error:
HAL: ERROR: duplicate component name 'iocontrol'
if you comment out the line
loadusr -W hal_input -KRAL SEM
Do you still get the 'iocontrol' error?
HAL: ERROR: duplicate component name 'iocontrol'
if you comment out the line
loadusr -W hal_input -KRAL SEM
Do you still get the 'iocontrol' error?
Please Log in or Create an account to join the conversation.
- abdulasis12
- Offline
- Premium Member
-
Less
More
- Posts: 131
- Thank you received: 8
21 May 2024 10:26 #301071
by abdulasis12
Replied by abdulasis12 on topic Keyboard Shortcuts in Gmoccapy
Attachments:
Please Log in or Create an account to join the conversation.
- Talla
- Offline
- Junior Member
-
Less
More
- Posts: 23
- Thank you received: 11
27 May 2024 17:55 - 27 May 2024 18:27 #301609
by Talla
Replied by Talla on topic Keyboard Shortcuts in Gmoccapy
Hi
i test this on my Machine and i think your UDEV is wrong.
My Inputdevice:
I: Bus=0003 Vendor=04b3 Product=3025 Version=0110
N: Name="LITE-ON Technology USB NetVista Full Width Keyboard."
Add this to your UDEV File ---- change the id´s to yours.
ATTRS{idVendor}=="04b3", ATTRS{idProduct}=="3025", GROUP="plugdev" ,MODE="0666"
Then open a Terminal make the following commands... with your naming
sudo adduser cnc plugdev
sudo udevadm trigger
halrun
loadusr -W hal_input -KRAL LITE
after that i get this
note: name is 'LITE-ON Technology USB NetVista Full Width Keyboard.'
halcmd: Note: Using POSIX realtime
I get no more permission warnings.
Here a Video from my testing today.....
youtu.be/aqY-ZunRbHU
Peter
i test this on my Machine and i think your UDEV is wrong.
My Inputdevice:
I: Bus=0003 Vendor=04b3 Product=3025 Version=0110
N: Name="LITE-ON Technology USB NetVista Full Width Keyboard."
Add this to your UDEV File ---- change the id´s to yours.
ATTRS{idVendor}=="04b3", ATTRS{idProduct}=="3025", GROUP="plugdev" ,MODE="0666"
Then open a Terminal make the following commands... with your naming
sudo adduser cnc plugdev
sudo udevadm trigger
halrun
loadusr -W hal_input -KRAL LITE
after that i get this
note: name is 'LITE-ON Technology USB NetVista Full Width Keyboard.'
halcmd: Note: Using POSIX realtime
I get no more permission warnings.
Here a Video from my testing today.....
youtu.be/aqY-ZunRbHU
Peter
Last edit: 27 May 2024 18:27 by Talla.
Please Log in or Create an account to join the conversation.
- PostavCNC
-
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
16 Mar 2025 15:03 - 16 Mar 2025 15:04 #324056
by PostavCNC
Replied by PostavCNC on topic Keyboard Shortcuts in Gmoccapy
Hi, there,
i am trying to make a keyboard shortcut to toggle between TURTLE and RABBIT jog mode. I think that the code should have look something like this:
if keyname == "r":
"some toggle event goes here"
return True
It is shown on in the def on_key_event section in the code attached from line 3052. Can you help me which event should I use to toggle jog modes?
i am trying to make a keyboard shortcut to toggle between TURTLE and RABBIT jog mode. I think that the code should have look something like this:
if keyname == "r":
"some toggle event goes here"
return True
It is shown on in the def on_key_event section in the code attached from line 3052. Can you help me which event should I use to toggle jog modes?
Last edit: 16 Mar 2025 15:04 by PostavCNC.
Please Log in or Create an account to join the conversation.
- HansU
-
- Offline
- Moderator
-
Less
More
- Posts: 678
- Thank you received: 203
21 Mar 2025 09:57 #324401
by HansU
Toggling does not really work without further changes, because it toggles the button twice then.
Adding two buttons is the simplest solution if that works for you.
Replied by HansU on topic Keyboard Shortcuts in Gmoccapy
Hi, there,
i am trying to make a keyboard shortcut to toggle between TURTLE and RABBIT jog mode. I think that the code should have look something like this:
if keyname == "r":
"some toggle event goes here"
return True
It is shown on in the def on_key_event section in the code attached from line 3052. Can you help me which event should I use to toggle jog modes?
Toggling does not really work without further changes, because it toggles the button twice then.
Adding two buttons is the simplest solution if that works for you.
if (keyname == "R" or keyname == "r"):
self.widgets.tbtn_turtle_jog.set_active(False)
if (keyname == "T" or keyname == "t"):
self.widgets.tbtn_turtle_jog.set_active(True)
Please Log in or Create an account to join the conversation.
- HansU
-
- Offline
- Moderator
-
Less
More
- Posts: 678
- Thank you received: 203
21 Mar 2025 10:04 - 21 Mar 2025 10:05 #324403
by HansU
Replied by HansU on topic Keyboard Shortcuts in Gmoccapy
Weird that it works with a small modification in a minimal running example but not in gmoccapy:
Maybe you have some time to play around and figure it out if it is important for you.
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
class ToggleButtonApp(Gtk.Window):
def __init__(self):
super().__init__(title="Toggle Button Example")
self.set_default_size(200, 100)
self.tbtn_turtle_jog = Gtk.ToggleButton(label="Button is OFF")
self.tbtn_turtle_jog.connect("toggled", self.on_chk_turtle_jog_toggled)
self.add(self.tbtn_turtle_jog)
self.connect("key-press-event", self.on_key_press)
def on_chk_turtle_jog_toggled(self, button):
if button.get_active():
button.set_label("Button is ON")
else:
button.set_label("Button is OFF")
def on_key_press(self, widget, event):
keyname = Gdk.keyval_name(event.keyval)
if keyname == "r" or keyname == "R":
self.tbtn_turtle_jog.set_active(not self.tbtn_turtle_jog.get_active())
return True # Stop further processing of the event
win = ToggleButtonApp()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
Maybe you have some time to play around and figure it out if it is important for you.
Last edit: 21 Mar 2025 10:05 by HansU.
Please Log in or Create an account to join the conversation.
Moderators: newbynobi, HansU
Time to create page: 0.151 seconds