Keyboard simulation within a userspace component

More
8 years 3 months ago #114742 by rodw
I have not written any userspace components but just wondering if the while(1) blocks execution at all?

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

  • AnnoyingMutt
  • New Member
  • New Member
More
8 years 3 months ago #114767 by AnnoyingMutt
Replied by AnnoyingMutt on topic Keyboard simulation within a userspace component
From the docs
Code:
option userspace yes - (default: no) If specified, this file describes a userspace (ie, non-realtime) component, rather than a regular (ie, realtime) one. A userspace component may not have functions defined by the function directive. Instead, after all the instances are constructed, the C function void user_mainloop(void); is called. When this function returns, the component exits. Typically, user_mainloop() will use FOR_ALL_INSTS() to perform the update action for each instance, then sleep for a short time. Another common action in user_mainloop() may be to call the event handler loop of a GUI toolkit.
From that I guess some form of loop is needed. (my basic understanding)
A While loop is used here
forum.linuxcnc.org/forum/18-computer/225...pendant-for-linuxcnc

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

  • AnnoyingMutt
  • New Member
  • New Member
More
8 years 3 months ago #115273 by AnnoyingMutt
Replied by AnnoyingMutt on topic Keyboard simulation within a userspace component

DaOne wrote: I am trying to create a custom keypad using an arduino to matrix the 130 key membrane keypad. I got the arduino side done sending each key as a code via serial. I plan to use the component that ArcEye created a while back as a base. I think I have all the pins figured as hal pins but I want the standard keyboard part to work as an actual keyboard for input. Is the a way in the .comp file to send a keystroke like if it was a real keyboard? Also if there is how would I handle "shift" commands? I can manage the shift key on the arduino side and just give every uppercase key a different key code.


This company has some interesting products
www.hagstromelectronics.com/usb-asc232-shp.html

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

More
8 years 3 months ago #115276 by dm17ry
i did a membrane keyboard controller using a STM32 as a USB HID. it emulates a standard keyboard plus a bunch of other keys which were handled by hal_input comp. rotary encoder and analog joystick can switch between being a mouse with a wheel and linuxcnc's MPG and joystick. 24-pos rotary switch is handled by an ADC. drives a chain of RGB addressable LEDs. also has a few hardware buttons for cycle start/stop etc...

if someone interested can share the code, but it is a bit more than a little messy, i think... :)

The following user(s) said Thank You: silopolis

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

  • AnnoyingMutt
  • New Member
  • New Member
More
8 years 3 months ago #115287 by AnnoyingMutt
Replied by AnnoyingMutt on topic Keyboard simulation within a userspace component
Ok that is cool.

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

More
8 years 3 months ago #115291 by tommylight

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

Time to create page: 0.063 seconds
Powered by Kunena Forum