P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2018-10-19 15:37:35

Registered: 2018-10-12
Posts: 3

Toggle Key Behavior on a Linux/Centos/Raspberry System

I want to toggle the behavior of 1 key on an X-keys® XK-8 Stick and an X-keys® XK-12 with joy Stick while using the device on a Centos system.  Eventually I want to use my XK device with a Raspberry Pi.

I read the article at http://xkeys.com/forum/viewtopic.php?id=135, "Get current backlight status" which discussed editing a script to toggle the lights on the device.  But since that involves a script, I do not think it will work in my case as the scripts are for Windows and not UNIX systems, correct?  I got that feature to work on my device when I have the device connected to a Windows system, but when I transfer the device to my Centos system, the color toggle stops working.

Note, although I plan to use my HW device on a Centos system, I am programming it on a Windows system using MacroWorks because in previous post on this forum, it was recommended that I use MacroWorks.

Also, when programming the device, I can select the 'Show Functions' button on the Macro pop up window.  This lists functions available.  There is a set called 'LED Control'.  It seems that these only work on Windows systems.  Is that correct.

How do I program my XK device so that I can get toggle or conditional behavior when the device is attached to a UNIX system?


#2 2018-10-22 09:36:19

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 142

Re: Toggle Key Behavior on a Linux/Centos/Raspberry System

If you want to use our keypad on a Linux system you will need to program it in "Hardware" mode so that the USB HID codes are stored on the device's memory and can then be brought over to the LINUX for use.

Launch MW3.1 and choose HW mode, go over to the "Functions" tab, the functions that are not available will be greyed out.

If you want to toggle the behavior of a single button, let's use the numbers 1&2 for this example:
Launch MW3.1 Select HW mode
In the "Keystrokes" tab program the number 1 and then go to the "Functions" tab and use the Device Layer_2 function.
Back in the main Window of MW3.1 use the drop down menu to select "Layer 2" and double click the same button
Here program the number 2 and use the Device Layer_1 function
File>Write to device

What you have now is a button that will toggle between the two layers and the macros on those layers test this out in NOTEPAD.
Now since you are using both layers it would be necessary to program the other macros on the device to both layers just so you don't lose their functionality when you've toggled to layer 2. If you'd like to toggle  the behavior on more than one key  I would suggest sacrificing just one key to act as a "Layer Toggle" and then program the other keys as desired.

If you want to change the back light states remember to  go to "Tools>Advanced>Disable Scripted Backlighting" before using the "Tools>X Keys Backlight Utility" to make the changes, otherwise the scheme will default back to the factory settings.


Board footer

Powered by FluxBB