Git Product home page Git Product logo

sidewinderd's Introduction

Sidewinder daemon

This project provides support for gaming peripherals under Linux. It was originally designed for the Microsoft SideWinder X4, but we have extended support for more keyboards. Our goal is to create a framework-like environment for rapid driver development under Linux.

Supported devices

  • Microsoft SideWinder X4
  • Microsoft SideWinder X6
  • Logitech G103
  • Logitech G105
  • Logitech G710
  • Logitech G710+

Install

Please check, if this project has already been packaged for your specific Linux distribution. Currently maintained packages:

If there are no packages available for your Linux distribution, please proceed with the manual installation from source:

  1. Install the following dependencies. Please refer to your specific Linux distribution, as package names might differ.
  • cmake 2.8.8 (make)
  • libconfig 1.4.9
  • tinyxml2 2.2.0
  • libudev 210
  1. Create a build directory in the toplevel directory:

    mkdir build
    
  2. Run cmake from within the new build directory:

    cd build
    cmake ..
    
  3. Compile and install:

    make
    make install
    

Usage

Enable and start Sidewinder daemon:

systemctl enable sidewinderd.service
systemctl start sidewinderd.service

Configure /etc/sidewinderd.conf according to your needs. Please change the user, as the default user is root.

You can now use your gaming peripheral! Please note, that there is no graphical user interface. Some LEDs might light up, letting you know, that Sidewinder daemon has successfully recognized your keyboard.

Record macros

The macro keys are fully programmable, but there is no default event. You can add functions to them, by recording macros or key combinations:

  1. Choose a profile. The profile LED on the device will show you, which profile is active.
  2. Press record key. The record LED will light up.
  3. Now, choose and press a macro key. On some devices, the record LED will begin to blink. You're now in macro mode. Please note, that existing macros may get overwritten.
  4. Everything you type on the keyboard will get recorded. You can either record a single key combination or a long series of keypresses. Please note, that keypresses still send events to your operating system and your programs.
  5. When done, press the record key again. This will stop recording and save the macro.
  6. You've now created a macro. Use it by setting the chosen profile and pressing the chosen macro key.

Contribution

In order to contribute to this project, you need to read and agree the Developer Certificate of Origin, which can be found in the CONTRIBUTING file. Therefore, commits need to be signed-off. You can do this by adding the -s flag when commiting: git commit -s. Pseudonyms and anonymous contributions will not be accepted.

License

This project is made available under the MIT License. For more information, please refer to the LICENSE file.

sidewinderd's People

Contributors

tolga9009 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sidewinderd's Issues

Process::createWorkdir failed with a new user account

In case of a new user account, the path .local/share doesn't exists yet in the home directory.
So, when the function Process::createWorkdir try to create the working dir (line 162 of process.cpp) it fails because mkdir doesn't create intermediate dirs.

This problem also occurs when the path specifyed in parameter workdir in sidewinderd.conf doesn't contain the path .local/share.

Adjustable Delay

I wasn't happy with the delay in keystrokes when I was recording macros. There are some cases where I would want the delay to be minimal between keypresses (but still have a slight delay built in). I built my own version as a test and I was happy with the result. I think the correct way to implement it though would be as a config setting. Would you want to add something like this?

systemctl --user service

Greetings.

First off, let me thank you for inventing the wheel I was contemplating first, and a very good wheel it is.

With that out of the way, have you considered the possibility of allowing this to be ran as non-root via systemd, eg, systemct --user start sidewinderd.service or systemctl --user enable sidewinderd.service ?

This would require some fairly trivial changes to the code and the use of udev rules to allow reading and writing /dev/uinput and /dev/input/event* nodes. Basically you'd remove all the daemon specific code and the seteuid type stuffs and treat it as a normal foreground process, letting systemd itself handle the daemon stuffs.

Is there a tutorial anywhere? Issue with xml keys

Hi, I'm new to Linux and found sidewinderd for my Logitech g105. I already installed it and made it run, as the macro recording didn't work, I search and found about the custom macros. Now I have this attached to M1-G1:

<Macro> <KeyBoardEvent Down="1">17</KeyBoardEvent> <DelayEvent>100</DelayEvent> <KeyBoardEvent Down="1">107</KeyBoardEvent> <DelayEvent>100</DelayEvent> </Macro>

The first time i hit the G1 key it work, now don't.. I wanted to level up volume, issue was the volume max out instantly not in steps by hitting the key multiple times or letting it pressed as I do in Win.

Can you send me a link to a tutorial to edit the xml, or explain me here how to do it?

G-keys leds are off too, even when i press them (M, config, lock w-key, work ok)

Logitech G710 no sidewinderd playback

It seems, everything works but there is no playback. Sidewinderd service starts at login, all of the led lights up, record seems to be working.
I use the latest sidewinderd from https://github.com/tolga9009/sidewinderd
I didn't change anything exept the user in /etc/sidewinderd.conf.
There is no encrypted user's directory.
When sidewinderd driver uninstalled, G key works as number.
I use Debian Stretch (testing).
Here are the locations of the files on my system just to show, I didn't reconfigure anything:
/etc/sidewinderd.conf
/etc/systemd/system/multi-user.target.wants/sidewinderd.service
/home/user/.local/share/sidewinderd
/usr/local/bin/sidewinderd
/usr/local/lib/systemd/system/sidewinderd.service
Let me know how should I solve this issue or if there is any ongoing bug related to this problem.
Thanks for this great driver.

initial LEDs are not set on start

After adding support for the Logitech G710+, I've forgotten a small piece of code in the constructor for setting up the initial LEDs. The intended behaviour is, that the profile LED should light up after starting sidewinderd (defaults to profile 1; can be set in .conf file). But currently, the LED profile only lights up, after pressing one of the LED buttons.

Fix is coming. Gonna update to 0.3.1 aswell.

Cheers,
Tolga

Fails to load tinyxml2-4.0.1 (update from 3.0.1)

/usr/bin/sidewinderd: error while loading shared libraries: libtinyxml2.so.3: cannot open shared object file: No such file or directory

Obviously there is now libtinyxml2.so.4. A simple symlink to the the new file works fine for me, so there should be no real changes necessary. You could try to load the version independent libtinyxml2.so instead.

Edit: Okay, i see that you search at build time for the libs and a rebuild solves the issue. But it would be still better if it directly prefers libtinyxml2.so (without specific version).

not executable a non-root

After the boot, there is a a process "sidewinderd" (by the users root and me) and the .pid file is created (in my unencrypted home folder). The "M1" key is illuminated, but nothing happens (neither by pressing the M nor the G-keys).

EDIT: Im using the Logitech G710+ on Linux with the 4.5 kernel.
EDIT2: after killing the process and starting it (as non root) i get this:

I/O error while writing file.
Sidewinderd v0.3.1 has been started.
Found device: 046d:c24d
Can't open hidraw interface

store config files in standard location

./sidewinderd is a nonstandard location for config files the XDG spec states that ~/.config/sidewinderd is the proper place

I will patch and do a pull request

Install Guide for Ubuntu 18.04

Took time for a noob like me to find the right dependencies:

sudo apt install libconfig++-dev libtinyxml2-dev libudev-dev

Also had an issue where I had to manually create this folder:

sudo mkdir -p /root/.local/share/sidewinderd

I made a quick guide (for myself), but thought that info may help you improve the README:
https://gist.github.com/cornernote/81affe26bdb15b7c49f4cceaae2f703f

Once I got that figured out everything works perfectly. It even records the delays (which is sometimes useful and sometimes annoying, but I worked out how to remove them in the XML, so all good).

Thank you so much for providing this tool!!!

Compile error

Can you help with the error?

"-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:2 (PROJECT):
No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

support for Logitech G815 Keyboard

I was using a G105 and sidewinderd has been perfect. I got a new G815 and plugged it in, half expecting it to work, however it didn't.

I'm not sure where to start. Any tips would be appreciated.

Incompatibility with caps2esc

Using https://gitlab.com/interception/linux/plugins/caps2esc for systemwide remapping of caps to escape.

Trying to run sidewinderd, macro record start seems to work, LEDs seem to work, but macros do not record.

Output of running sudo sidewinderd, then typing the sequence MR G1 asdf MR:

Start Macro Recording on /dev/input/event20
asdfgetFeatureReport(6) returned: 6 90
Exit Macro Recording

build failing on Arch

Just a heads up, make is failing right now in Arch. Both the AUR PKGBUILD and my manually pulling and building. Cmake works fine, no errors, here is the make error:

Scanning dependencies of target sidewinderd
[  7%] Building CXX object src/CMakeFiles/sidewinderd.dir/main.cpp.o
[ 15%] Building CXX object src/CMakeFiles/sidewinderd.dir/process.cpp.o
[ 23%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/device_manager.cpp.o
[ 30%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/hid_interface.cpp.o
[ 38%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/key.cpp.o
[ 46%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/keyboard.cpp.o
[ 53%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/led.cpp.o
[ 61%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/led_group.cpp.o
[ 69%] Building CXX object src/CMakeFiles/sidewinderd.dir/core/virtual_input.cpp.o
[ 76%] Building CXX object src/CMakeFiles/sidewinderd.dir/vendor/logitech/g105.cpp.o
[ 84%] Building CXX object src/CMakeFiles/sidewinderd.dir/vendor/logitech/g710.cpp.o
[ 92%] Building CXX object src/CMakeFiles/sidewinderd.dir/vendor/microsoft/sidewinder.cpp.o
[100%] Linking CXX executable sidewinderd
CMakeFiles/sidewinderd.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x6b9): undefined reference to `libconfig::Setting::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
main.cpp:(.text+0x714): undefined reference to `libconfig::Setting::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/sidewinderd.dir/build.make:381: src/sidewinderd] Error 1
make[1]: *** [CMakeFiles/Makefile2:86: src/CMakeFiles/sidewinderd.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Using:

tinyxml2 4.0.1-1
libconfig 1.5-3
systemd 232-8
cmake 3.8.1-1

First time submitting a bug report, sorry if I'm missing pertinent info.

Modifier keys not working in macros

When recording a macro with modifier keys (shift, alt gr) they seem to not work. E.g. I have a macro to print {,.pacnew} but it gets printed as 7,.pacnew0. This worked in prior releases.

The modifier keys are recorded correctly, as I saw in the XML files. They are also working in shortcuts. The only problem is that they are not working correctly when the macro is used to print text somewhere.

sidewinderd[2817]: Error accessing /root/.local/share/sidewinderd.

Hi !
I have been using sidewinderd for a while in different distros and it has been working really well and it has been a great tool. So thanks a bunch for creating this.

However I have run in to a problem with my latest install.
I´m on Arch and I have tried both the sidewinderd and sidewinderd-git from tha AUR and I have tried to compile and installing it manually by downloading directly from this repo. But my problem is the same and it persists. After enabling and starting the service nothing happends and it doesn´t start.

When doing systemctl status sidewinderd.service in terminal I get this:

sidewinderd.service - Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+
     Loaded: loaded (/usr/local/lib/systemd/system/sidewinderd.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2020-07-14 21:16:35 CEST; 14s ago
    Process: 2817 ExecStart=/usr/local/bin/sidewinderd (code=exited, status=1/FAILURE)
   Main PID: 2817 (code=exited, status=1/FAILURE)

jul 14 21:16:35 mrazsternator systemd[1]: Started Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+.
jul 14 21:16:35 mrazsternator sidewinderd[2817]: Error accessing /root/.local/share/sidewinderd.
jul 14 21:16:35 mrazsternator systemd[1]: sidewinderd.service: Main process exited, code=exited, status=1/FAILURE
jul 14 21:16:35 mrazsternator systemd[1]: sidewinderd.service: Failed with result 'exit-code'.

I have looked for /root/.local/share/sidewinderd as mentioned in the errorcode, but it´s simply just not there. Any ideas or mabye point me in a direction as where to look ?

Possible bug/user inconvenience in handling the maximum number of banks/profiles.

The current maximum number of supported profiles is stored here as const int MAX_PROFILE = 3;

const int MAX_PROFILE = 3;

It is used in keyboard.cpp to create the macro storage folders for each profile. This is not a problem.
Just for reference, exactly here:
for (int i = MIN_PROFILE; i < MAX_PROFILE; i++) {

The actual problem is that this constant originates from sidewinder.hpp and is still used with a different purpose in sidewinder.cpp, here:

profile_ = (profile_ + 1) % MAX_PROFILE;

This will lead to a bug as soon as another keyboard is added that offers >= 4 profiles. MAX_PROFILE will be increased and the code in sidewinder.cpp will break without notice, because it depends on that constant being exactly 3.
The profile rotation for the Sidewinder keyboard should always be 1 → 2 → 3 → 1.
Let MAX_PROFILE be redefined to 10. Then the profile rotation on the sidewinder keyboard will become 1 → 2 → 3 → 3 → 3 → 3 → 3 → 3 → 3 → 3 → 1, which I consider as unintended.

Possible fix for that possible bug:
Use a constant per keyboard, so that adding new keyboards won’t break old ones.
MAX_PROFILE in keyboard.hpp must then be set to the maximum profile number across all supported keyboards.

Building fails despite latest tinyxml (Linux Mint 17.3 / Ubuntu 14.04.5)

Both building with the latest commit and release 0.4.0 fails under Linux Mint 17.3 (aka Ubuntu 14.04.5 LTS):

/home/fwolf/inst/sources/logitech-g710/sidewinderd/sidewinderd-0.4.0/src/core/keyboard.cpp: In member function ‘void Keyboard::recordMacro(std::string, Led*, int)’:
/home/fwolf/inst/sources/logitech-g710/sidewinderd/sidewinderd-0.4.0/src/core/keyboard.cpp:125:17: error: ‘class tinyxml2::XMLElement’ has no member named ‘SetText’
     DelayEvent->SetText(static_cast<int>(delay));
                 ^
/home/fwolf/inst/sources/logitech-g710/sidewinderd/sidewinderd-0.4.0/src/core/keyboard.cpp:138:19: error: ‘class tinyxml2::XMLElement’ has no member named ‘SetText’
    KeyBoardEvent->SetText(inev.code);

Installed dependencies:

  • libconfig: 1.4.9-2 (package: libconfig++9)
  • tinyxml2: 2.6.2 (package: libtinyxml2.6.2)
  • libudev: 204-5ubuntu20 (package: libudev-dev)

cu, w0lf.

tinyxml2 upgrade broke daemon

Just now noticed this and I did several large and dependent heavy upgrades today, so I do not know for certain which one bumped tinyxml2 from 0.5 to 0.6, but systemctl fails to start sidewinderd.service without libtinyxml2.so.5. However the fix was simple, and a symlink pointing to the newer lib worked:

ln -s /usr/lib/libtinyxml2.so.6.0.0 /usr/lib/libtinyxml2.so.5

Kernel: 4.14.4-1-ARCH x86_64 bits: 64 Desktop: Cinnamon 3.6.6 Distro: Arch Linux

Just wanted to make you aware incase this is distro specific or someone else comes by wondering what to do. A downgrade to tinyxml2 probably would cause a dependency apocalypse if you do any dotnet CLI or any kind of coding via CLI, let alone normal use issues.

Sidewinderd fails on resume from suspend

I am on a fully-updated archlinux with a logitech G710+ keyboard. Everything works perfectly on boot, but when the computer is resumed after being suspended with systemctl suspend, the keyboard's extra functionality is no longer active (none of the macro lights are on either). After restarting sidewinderd.service, everything goes back to working.

I have included the output of journalctl -u sidewinderd.service -b, but it doesn't look like there is anything special there - it simply shows the service starting Aug 15, and being restarted manually on Aug 18:

Command output
Aug 15 22:31:34 maestro systemd[1]: Started Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+.
Aug 15 22:31:34 maestro sidewinderd[996]: Started sidewinderd.
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Keyboard Constructor
Aug 15 22:31:35 maestro sidewinderd[996]: getFeatureReport(6) returned: 6 0
Aug 15 22:31:35 maestro sidewinderd[996]: getFeatureReport(6) returned: 6 0
Aug 15 22:31:35 maestro sidewinderd[996]: getFeatureReport(6) returned: 6 0
Aug 15 22:31:35 maestro sidewinderd[996]: getFeatureReport(6) returned: 6 0
Aug 15 22:31:35 maestro sidewinderd[996]: getFeatureReport(6) returned: 6 0
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:35 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 15 22:31:36 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 16 00:35:38 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 16 00:35:39 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 16 00:35:39 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 16 00:35:39 maestro sidewinderd[996]: Found device: 046d:c24d
Aug 18 22:47:39 maestro sidewinderd[996]: Stop signal received.
Aug 18 22:47:39 maestro sidewinderd[996]: Stopped sidewinderd.
Aug 18 22:47:39 maestro sidewinderd[996]: LogitechG710 Destructor
Aug 18 22:47:39 maestro systemd[1]: Stopping Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+...
Aug 18 22:47:43 maestro sidewinderd[996]: Keyboard Destructor
Aug 18 22:47:43 maestro systemd[1]: sidewinderd.service: Succeeded.
Aug 18 22:47:43 maestro systemd[1]: Stopped Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+.
Aug 18 22:47:43 maestro systemd[1]: Started Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+.
Aug 18 22:47:43 maestro sidewinderd[1733460]: Started sidewinderd.
Aug 18 22:47:43 maestro sidewinderd[1733460]: Found device: 046d:c24d
Aug 18 22:47:43 maestro sidewinderd[1733460]: Keyboard Constructor
Aug 18 22:47:43 maestro sidewinderd[1733460]: getFeatureReport(6) returned: 6 0
Aug 18 22:47:43 maestro sidewinderd[1733460]: getFeatureReport(6) returned: 6 0
Aug 18 22:47:43 maestro sidewinderd[1733460]: getFeatureReport(6) returned: 6 0
Aug 18 22:47:43 maestro sidewinderd[1733460]: getFeatureReport(6) returned: 6 0
Aug 18 22:47:43 maestro sidewinderd[1733460]: getFeatureReport(6) returned: 6 0
Aug 18 22:47:43 maestro sidewinderd[1733460]: Found device: 046d:c24d
Aug 18 22:47:43 maestro sidewinderd[1733460]: Found device: 046d:c24d

SSL URL for submodule causes 'permission denied' for clone

Please use https url for the tinyxml2 submodule, as the SSL url requires users to have read/write permission on the tinyxml2 repo (error output below).

If you use the https url, then the aur install will also start working.

Thanks,

Matt

Submodule 'lib/tinyxml2' (ssh://[email protected]:22/leethomason/tinyxml2.git) registered for path 'lib/tinyxml2'
Cloning into 'lib/tinyxml2'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of 'ssh://[email protected]:22/leethomason/tinyxml2.git' into submodule path 'lib/tinyxml2' failed

Keyboard not detected if connected after service start

I'm running "sidewinderd version 0.4.0" on Manjaro

I just got a "Port 2 Computers Peripheral Switcher" to... easily switch my USB inputs between computers.

If I boot with the keyboard switched to the booting computer, everything is fine. Sidewinderd picks up on the keyboard (a G105) after switching away and back.

If I forget and switch to to proper computer after boot, keyboard and mouse are picked up, but the macro keys don't activate until I restart the service.

Maybe this is a udev rule to be written?

sidewinderd needs to be reloaded after boot, if the user folder is encrypted

sidewinderd can't access user folders, if the home folder is encrypted. This is only true, when sidewinderd is running as a non-root user - which is the preferred and recommended method. This can probably be fixed by letting sidewinderd.service wait for the harddrive encryption service to finish by using "After" parameter. Original bug report: http://ubuntuforums.org/showthread.php?t=1543370&page=6&p=13278148#post13278148

Cheers,
Tolga

Crash on invalid username

Hi, I have the Logitech G710+ keyboard and have used sidewinderd for a number of years with no issue.

I recently changed my unix username, and until I fixed the username in the sidewinderd configuration, the daemon segfaulted at started. It should report a readable error and fail cleanly instead.

G105 support and a more generic approach to Logitech G-Series keyboards

Hello, been using/testing your program with my G710 (yes, not the G710+. The two devices are apparently identical except for which switches are used for the keys) and I must say I rather like it so far. Some tweaks I'd like to see, but other than that, very useable.

I also have a G105, which I've dumped enoug info on to probably be addable to this as well, but most of the code would be pretty much identical to logitech_g710p.{c,h}pp that it would perhaps be better to generalize it somehow, but I'm not terribly good enough of a programmer to figure out myself.

The specifics are:

  • a 7 byte report with id 0x08 to null out the gkeys (they send f1-6 by default)
  • the g/mkeys send a 3 byte report in the format 0x03 gg mm, but m1 for example is 0x01 instead of 0x10 like the G710
  • the leds are controlled on report 0x06, but again, 0x01 instead of 0x10 and so on.

Microsoft Sidewinder X6 Special Keys not working

I am using sidewinderd with my Microsoft Sidewinder X6 keyboard. No input is being detected from keys S1 through to S12.
The numpad only works when it's in regular mode. When it is switched to Special Key mode (yellow lighting), no input can be detected.
S13, the media keys and the turbo key work as expected.
The profile switcher and the special key switcher labeled [1|2] at least have an effect on the lights on the keyboard. No statement can be made about their functionality or that of the macro recording key.

Operating System: Arch Linux
KDE Plasma Version: 5.22.0
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.9-arch1-1 (64-bit)
Graphics Platform: X11

Binding macro keys to shell commands

Is it possible to have a key binding run a shell command? This way a macro key could be used to, for example, start a batch job, run a program in a certain configuration, etc.

Sidewinderd can't be stopped, while in record mode

While in record mode, sidewinderd can't be stopped by pressing CTRL+C. It will wait infinitely or until an extra / macro key has been pressed.

This is not intended behaviour. sidewinderd should be able to terminate in every situation within a timeout.

Macro keys not exposed to system

I have a Logitech G710+ and using KDE Neon (a mix between long-term stable Ubuntu and latest cutting-edge KDE).
While the macro recording works flawlessly, it seems that the G* keys are not directly exposed to the system itself, thus I can't bind my macro keys to shell commands, windows actions, etc in KDE System Settings -> Shortcuts -> Custom Shortcuts.

The only workaround is to record an unused bizarre combination of keys (Ctrl + Shift + Meta + Alt + whatever) with the built-in macro recorder and then bind that combination as trigger to our actions, right? Is there an option or way to expose extra keys to the system?

I was using https://github.com/boombatower/logitech-g710-linux-driver and keys where directly 'bindable' in KDE System Settings -> Shortcuts -> Custom Shortcuts (even with M* keys as modifiers).
I came here to try this for the convenience of having a service instead of a kernel module (plus I had some troubles with some windows ignoring macro keys). Does that difference in the approach (service vs module) have to do something with those macro keys not working the way I expect?

XML explanation/example requested

Can the readme or wiki expand on how to write the XML files? I've run through the issues and have found snippets of XMLs but they don't fully list all the available commands. Even an sample XML with different examples would be really useful for simple minds like mine. Specifically, I could only figure out how to configure macro keys to output on a key down press but holding down the key did not repeat the input (like a typical key would). How can I configure a macro key to behave just like another key, with the system's repeat delay and repeat rate?

System information:
Kernel version: 5.9.16-1-MANJARO
OS Type: 64-bit
DE: KDE Plasma
Sidewinderd version: 0.4.3-1 from AUR

Also, really appreciate the work done on this software. Thanks so much!

Service crashes when keyboard is unplugged

I have Logitech G710+ connected to Lenovo Thinkpad TB3 dock and that is connected to Dell Precision 5530. I have Ubuntu 20.04 installed.

While sidewinderd's service is running if I unplug my laptop from the dock, or alternatively unplug keyboard's usb cable (the one with keyboard's logo on it) from the dock, the service crashes. After plugging the keyboard back in, I need to restart the service to get the my macro keys working again.

Service's status after unplugging (happened at 11:27:59):

$ sudo systemctl status sidewinderd.service
● sidewinderd.service - Support for Microsoft SideWinder X4 / X6 and Logitech G105 / G710+
     Loaded: loaded (/usr/local/lib/systemd/system/sidewinderd.service; enabled; vendor preset: enabled)
     Active: failed (Result: core-dump) since Tue 2020-07-14 11:27:59 EEST; 35s ago
    Process: 1219617 ExecStart=/usr/local/bin/sidewinderd (code=dumped, signal=SEGV)
   Main PID: 1219617 (code=dumped, signal=SEGV)

heinä 14 11:27:23 codebox sidewinderd[1219617]: Unable to find parent device.
heinä 14 11:27:23 codebox sidewinderd[1219617]: Unable to find parent device.
heinä 14 11:27:23 codebox sidewinderd[1219617]: Unable to find parent device.
heinä 14 11:27:23 codebox sidewinderd[1219617]: Unable to find parent device.
heinä 14 11:27:23 codebox sidewinderd[1219617]: Unable to find parent device.
heinä 14 11:27:23 codebox sidewinderd[1219617]: Unable to find parent device.
heinä 14 11:27:23 codebox sidewinderd[1219617]: Found device: 046d:c24d
heinä 14 11:27:59 codebox sidewinderd[1219617]: Keyboard Destructor
heinä 14 11:27:59 codebox systemd[1]: sidewinderd.service: Main process exited, code=dumped, status=11/SEGV
heinä 14 11:27:59 codebox systemd[1]: sidewinderd.service: Failed with result 'core-dump'.

Map macro keys directly to other keys

Would it be viable to map macro keys directly to other keys / scancodes? That is, mapping "key down" and "key up" events directly to another key. This way I could use macro keys as modifier keys.

Unable to make install

Just trying to compile this from source on Linux Mint 18.3.

snuupy@SnuT470p ~/Documents/sidewinderd/build $ sudo apt install cmake libconfig++-dev libtinyxml2-dev libudev-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libconfig++-dev is already the newest version (1.5-0.2).
libtinyxml2-dev is already the newest version (2.2.0-1.1ubuntu1).
cmake is already the newest version (3.5.1-1ubuntu3).
libudev-dev is already the newest version (229-4ubuntu21).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
snuupy@SnuT470p ~/Documents/sidewinderd/build $ ls
CMakeCache.txt  CMakeFiles  cmake_install.cmake  Makefile  src
snuupy@SnuT470p ~/Documents/sidewinderd/build $ cmake ..
-- Found Config++: /usr/lib/x86_64-linux-gnu/libconfig++.so
-- Found TinyXML2: /usr/lib/x86_64-linux-gnu/libtinyxml2.so
-- Found UDev: /usr/lib/x86_64-linux-gnu/libudev.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/snuupy/Documents/sidewinderd/build
snuupy@SnuT470p ~/Documents/sidewinderd/build $ make
[100%] Built target sidewinderd
snuupy@SnuT470p ~/Documents/sidewinderd/build $ make install
[100%] Built target sidewinderd
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/sidewinderd
CMake Error at src/cmake_install.cmake:42 (file):
  file INSTALL cannot copy file
  "/home/snuupy/Documents/sidewinderd/build/src/sidewinderd" to
  "/usr/local/bin/sidewinderd".
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)
  


Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1

Library versions on system:
libtinyxml2-dev=2.2.0-1.1ubuntu1
cmake=3.5.1-1ubuntu3
libconfig++-dev=1.5-0.2
libudev-dev=229-4ubuntu21

Wont play macro

Found device: 045e:0768
Can't open uinput
Keyboard Constructor
getFeatureReport(7) returned: 7 4
getFeatureReport(7) returned: 7 0
getFeatureReport(7) returned: 7 0
getFeatureReport(7) returned: 7 0
getFeatureReport(7) returned: 7 0
getFeatureReport(7) returned: 7 0
getFeatureReport(7) returned: 7 4
getFeatureReport(7) returned: 7 64
Start Macro Recording on /dev/input/event3
getFeatureReport(7) returned: 7 44
Exit Macro Recording

Recorded "sudo !!" on S1 and got this output but it wont type that in the console or in any text field.

Im using M$ X4, kernel is x86_64 Linux 4.8.11-1-ARCH and desktop env is XFCE4

Remapping keys in X11

Edit after a YEAR: Solution was just SHIFT + F1-F12. See this comment for details.

Keyboard management in X11 is a mess. There are two reasons for this:

  • X server uses a two layered event handling, which consists of keysym and X-key code. keysym is the actual representation of a given letter. On the other hand, X-key code, as you might guess, is a predefined list of key codes which varies on a given X server implementation and on a physical keyboard. Thus, there isn't any standard for which key ties to which unlike as in Linux Kernel, or at least I couldn't found one. (For more information, please visit: VMware)
  • X server currently supports only one-byte values, which means 255 different key codes.

The problem I had with that I can't assign my G keys through F13-F18 as mentioned in #35, as F13-F18 keys aren't supported in X-key code even though they had defined in keysymdef.h see below.

Another problem that may arise is with the key codes bigger than one-byte, which are generally media controls. They are completely ignored when pressed.

Both of the problems can be solved by binding them to the keys in the 0-255 range.

To view your X-key codes, use: xmodmap -pke
To view the key code of which key you press, use: xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }' (from archwiki)

For the keys, I used XF86Launch1 - XF86Launch6, instead of F13-F18 and then configured my programs according to these keys.

  • Assigning G keys: In my X server configuration, my key codes for XF86Launch1 - XF86Launch6 are respectively: 156, 157, 210, 211, 192, 193. I don't know why but to be able to define them as mentioned in #35 , I had to decrease them by eight. So for example, my s1.xml key macro has the contents of:
<Macro>
    <KeyBoardEvent Down="true">148</KeyBoardEvent>
    <KeyBoardEvent Down="false">148</KeyBoardEvent>
</Macro>
  • Assigning keys that are bigger than one-byte: You can follow this guide on archwiki.

Hope this helps @tolga9009, especially when writing a GUI in the future.

Cheers.

100% CPU usage when the keyboard is unplugged

I've just compiled and installed the driver in Ubuntu (same behaviour in 15.04 and 15.10)
The service works well until I unplug the keyboard. Then, sidewinderd hangs with 100% CPU usage. Plugging the keyboard again does not restore functionality, and the macro keys do not work anymore.

Weird (buggy?) logic in handling bank switching/macro mode for Sidewinder keyboards

The behaviour of the bank switch key and macro pad switch key is weird and may need a cleanup, (if this is not the intended behaviour).
Previous behaviour was: Pressing the ‘sidewinder’ button permanently switched between keypad mode and macro pad mode. Bank switch key simply rotated through the 3 available banks.

What happens now:

  1. Pressing the sidewinder button switches the bank selection LED OFF (all 3 LEDs, of which one should always be lit).
  2. A bank switch resets the keypad back to keypad mode.
  3. Directly after switching the bank: Switching to macro pad mode requires an alternating amount of key presses, alternating between one and two presses:
    Press bank switch. Requires pressing sidewinder button once to enable macro mode. Press bank switch. Requires 2 presses to enable macro mode. Press bank switch. Again requires 1 press to enable macro mode.
  4. Point 3 does not occur if the keypad was manually switched back to keypad mode. This one indicates that point 3 is actually unintended.

Which of those 3 modes would be the best?

  1. Permanently assign keypad/macropad mode for each bank independently (up until user reconfiguration). E.g. bank 1 is always keypad mode, bank 2 and 3 switch the keypad to macro mode. This is the original solution by Microsoft. It would free up the sidewinder key for other uses. (maybe for mentioned permanent reconfiguration).
  2. Bank switch and macro pad switch are independent. Switching the bank does not alter keypad/macropad mode and vice versa. This is the old behaviour.
  3. Switching the bank always resets the keypad to keypad mode, regardless of previous mode. This is the current behaviour.

Is there any way to assign media controls to the G keys?

I was hoping to assign things like Volume up/down/mute to my G keys, but I'm relatively new to Linux, and after searching through documents here, I can't seem to find any way to do it, or if it's even possible..
EDIT:
Thanks for the reply! That worked perfectly! Not sure how I missed those event codes. heh

README edit

In the README, probably want to enable sidewinderd before starting it, rather than the other way around.

Sidewinderd on Gentoo Linux

Hi, I just want to mention that I have created a Gentoo Linux "ebuild" for sidewinderd. An ebuild is a build-from-source-and-install recipe for the Gentoo package manager, so installing sidewinderd can now be done conveniently also on Gentoo Linux. For details read here.

Logitech G103

Hello! Would it be possible to make support for G103 keyboard? It has 6 G-keys, similar to G105:
image

Crash while doing something?

Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: Found device: 045e:0768
Okt 01 18:33:14 g550jk sidewinderd[31327]: terminate called after throwing an instance of 'std::logic_error'
Okt 01 18:33:14 g550jk sidewinderd[31327]: what(): basic_string::_M_construct null not valid
Okt 01 18:33:14 g550jk systemd[1]: sidewinderd.service: Main process exited, code=killed, status=6/ABRT
Okt 01 18:33:14 g550jk systemd[1]: sidewinderd.service: Unit entered failed state.
Okt 01 18:33:14 g550jk systemd[1]: sidewinderd.service: Failed with result 'signal'

I have no idea what happened there or what I did there :/

And another question: where (which file) does sidewinderd store the macros? EDIT: Found it: ~/.local/share/sidewinderd/, that information should be added to the README though.

Recording works with plugged-out mouse - playback not

Hi there,
great thing, you try to get all the functionalities working!!

After compiling and starting sidewinderd I found out, that recording only works with plugged-out mouse.

But the playback doesn't work neither way.
I checked the xml files and there's content - looks good!

...
<DelayEvent>10</DelayEvent>
<KeyBoardEvent Down="0">30</KeyBoardEvent>
<DelayEvent>100</DelayEvent>
<KeyBoardEvent Down="1">50</KeyBoardEvent>
<DelayEvent>10</DelayEvent>
...

I am running Linux Mint 17 (based on Ubuntu 14.04).
Do you need any logfiles?

Would be great if I got these keys to work 👍
Regards
Max

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.