Control panel, MUX wiring help

More
5 years 8 months ago #197268 by rodw
Replied by rodw on topic Control panel, MUX wiring help

phillc54 wrote: I think the keyboard module requires root.


Seems so but I think It just gets the keys using a program called dump. You could try saving the dump to a text file and using that.

But also pyAutoGUI seems to do the same thing.

pyautogui.readthedocs.io/en/latest/#

Man the last time I played with this stuff it was in the DOS days.

Please Log in to join the conversation.

More
5 years 8 months ago #197269 by rodw
Replied by rodw on topic Control panel, MUX wiring help

andypugh wrote:

rodw wrote: I have not tried this but:
You should be able to write a component in Python to "stuff" data (single character or a string) into the keyboard buffer.


The first version of matrix_kb had this capability. But it did it by calling external kernel routines, and there was a worry that we had no way to know that these were thread-safe so it was taken out.

This commit is where I removed that code:
github.com/LinuxCNC/linuxcnc/commit/b494...c3b3790a457e1ed354c8
So if that was all put in a separate userspace component, the matrix_kb could look (partially) like a standard keyboard to the OS.
(In a userspace component there is no need to worry about thread safety)


I wonder how this would be treated in PREMPT_RT? I thought it basically removed any non-thread safe code.

Please Log in to join the conversation.

More
5 years 8 months ago #197270 by andypugh

rodw wrote: I wonder how this would be treated in PREMPT_RT? I thought it basically removed any non-thread safe code.


userspace HAL components (In C and Python) work in all supported realtime systems.

Please Log in to join the conversation.

More
5 years 8 months ago #197273 by rodw
Replied by rodw on topic Control panel, MUX wiring help
So this example from the page above seems to work just from the python prompt
Code:
import pyautogui pyautogui.write('Hello world!', interval=0.25) # type with quarter-second pause in between each key

Auto types "Hello World" If you Select a text editor, it still types happily away

There seems to be a lot more you can do.
This is cool too
Code:
pyautogui.alert('This is the message to display.') # Make an alert box appear and pause the program until OK is clicked.

It would be pretty easy from here to make it a real keyboard...

Please Log in to join the conversation.

More
5 years 8 months ago #197284 by RotarySMP
Luckily I sold that Maho menbrane keyboard, before you guys tempted me down this rabbit hole :)

Please Log in to join the conversation.

More
5 years 8 months ago #197495 by andypugh
I am well down the rabbit hole, I have a HAL component that consumes the scancodes from matrix_kb or from a 7i73 and converts them to keystrokes.

I even had a prox limit switch connected via an STMBL drive typing the letter "c" in the terminal.

But then I broke it again, but it seems that it will work.

Watch this space.

Please Log in to join the conversation.

More
5 years 8 months ago #197497 by rodw
Replied by rodw on topic Control panel, MUX wiring help

andypugh wrote: I even had a prox limit switch connected via an STMBL drive typing the letter "c" in the terminal.

But then I broke it again, but it seems that it will work.

Watch this space.


So was it C for Curious or C for Cool?

Sounds exciting either way! I have a circuit board here waiting on one part before it turns into a shield for the 7i73... well hoping a mate will turn it into said shield cos he's much more into SMD soldering than I am!

Please Log in to join the conversation.

More
5 years 8 months ago #197542 by RotarySMP
Maybe one of these set up as a fourth axis (C Axis) to push the button on the keyboard for you :)

Mark

Please Log in to join the conversation.

More
5 years 8 months ago #197566 by tommylight
LOL, this one has evolved a fair bit ! :)

Please Log in to join the conversation.

More
5 years 8 months ago #197596 by Todd Zuercher
Not sure why, but that really struck me funny. Thanks

Please Log in to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum