Coder Social home page Coder Social logo

zocker-160 / keyboard-center Goto Github PK

View Code? Open in Web Editor NEW
64.0 5.0 2.0 3.14 MB

Application for mapping macro keys on Logitech keyboards

License: GNU General Public License v3.0

Python 98.87% Shell 1.13%
keyboard logitech logitech-gaming logitech-gaming-keyboard g910 g710 g815 hacktoberfest linux

keyboard-center's Introduction

keyboard-center Keyboard Center

DEB builder

Keyboard Center is an application attempting to create an easy way for users to map their macro keys of their >100$ keyboard to useful actions, because Logitech does not give a fuck.

Unlike some other solutions, this application works alongside with RGB software like OpenRGB!

showcase

NOTE: This application is written for Linux only, on Windows use whatever bloatware the vendor wants you to use.

Features

  • Mapping of keys, combos and macros
  • Ability to map commands to keys
  • Ablity to add delays to macros
  • libhidraw backend and libusb as backup if needed (libusb only < 0.2.0)
  • Support for switching LEDs of profile keys
  • Import and export of the configuration (added ability to open configuration folder instead)
  • openRGB integration - linking of macro profiles with openRGB profiles
  • Application specific profiles (on hold until there is a common way to do this on Wayland1)

Supported Keyboards

  • Logitech G910 Orion Spectrum (046d:c335)
  • Logitech G910 Orion Spark (046d:c32b) (thanks to @microdou)
  • Logitech G710+ (046d:c24d) (big thanks to @nirenjan)
  • Logitech G815 (046d:c33f) (thanks to @nickbuss)
  • Logitech G510 (046d:c22d) (thanks to @Flying--Dutchman)
  • Logitech G510 (046d:c22e) (thanks to @JoZ3)
  • Logitech G935 (046d:0a87) (partial support) (thanks to @coxaka)

Install

Arch / Manjaro

available in the AUR: [AUR] keyboard-center

Debian / Ubuntu

  • Download .deb from release page
  • Install using package manager of your choice or in terminal: apt install ./<packagename>.deb

Setup OpenRGB Integration

Step 1: Create Profile(s) in OpenRGB

OpenRGBprofiles

Step 2: Specify Profile in Keyboard Center

OpenRGBkeyboardcenter

note: if you install OpenRGB after Keyboard Center, you will need to restart it.

Manage Background Service

Keyboard Center places itself into the system tray (unless disabled see CLI options).

If you try to open a secondary instance, it will should reactivate the primary one if minimized or hidden.

Settings

Settings are stored in a settings.yml file, which is located at

  • $XDG_CONFIG_HOME/keyboard-center or if not defined
  • $HOME/.config/keyboard-center

CLI options

  • -v --version: prints version (duh)
  • --background-mode: hides tray icon
  • --dev: meant for development purposes only

Current default settings

settings: {usbTimeout: 1000, retryCount: 5}

Known issues

Icons on buttons and in the menu not visible

Keyboard-center relies on icons provided by the desktop environment. Some DEs (like i3) don't seem to provide those, so in that case you can manually overwrite the used icon them by setting XDG_SESSION_DESKTOP and XDG_CURRENT_DESKTOP ENV variables.

Two known good values are KDE (recommended) and GNOME.

Thanks to @scott-carrion for this info.

Dependencies

Debian / Ubuntu

  • python3 >= 3.9
  • python3-pyqt5 >= 5.15
  • python3-usb
  • python3-uinput
  • python3-ruamel.yaml
  • libhidapi-hidraw0
  • libnotify-bin

Arch / Manjaro

  • python >= 3.9
  • python-pyqt5 >= 5.15
  • python-uinput >= 0.11.2
  • python-ruamel-yaml >= 0.15
  • python-pyusb >= 1.0.2
  • hidapi >= 0.10
  • libnotify >= 0.7.9

Contribute New Keyboard

  • make sure all required dependencies are installed + git
  • git clone https://github.com/zocker-160/keyboard-center
  • cd keyboard-center
  • make sure that usbVendor and usbProduct in src/newDeviceDebugger.py is set properly
    (you can check with lsusb)
  • you might need to run the following commands with sudo if you get permission errors
  • python3 src/newDeviceDebugger.py and press all memory keys, macro keys and multimedia keys one after each other
  • python3 src/newDeviceDebugger.py --info
  • exit with CTRL + C (can take a second or two)
  • open a new issue and provide output of the last two commands and the USB ID of your keyboard

overall it should look something like this:

addKeyAnim

ko-fi

Footnotes

  1. For more information see this and this and this

keyboard-center's People

Contributors

nirenjan avatar zocker-160 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

Watchers

 avatar  avatar  avatar  avatar  avatar

keyboard-center's Issues

please add support for MX-Linux

MX is based on Debian so it seems like it should work, but it doesn't.

The error it fails with is that it cannot find the module "package"

On Laptop wake up

Hey,
Great project thank you for all your efforts.
I'm having an issue where the deamon previously and now the taskbar stop working when the laptop wake up.
I wrote a script that kill & start the deamon on previous version but it's not optimal because I had to run it manually.
Any suggestion to handle this issue ?
Thanks

trying to configure g815

Hello!!!
I'm trying to configure memory 1 to move between desktops (I'm assigning ctrl+ f1) but I can't get it to work.... it doesn't respond to the configurations

mappings: MEMORY_1: MACRO_1: gamemode: 0 name: CustomProfile string: - [Ctrl, F1] - [Ctrl, F2] - [Ctrl, F3] type: macro value: - - [1, 29] - [1, 59] - - [1, 29] - [1, 60] - - [1, 29] - [1, 61] MACRO_2: name: example-cut string: - [Ctrl, X] - [Ctrl, V] type: macro value: - - [1, 29] - [1, 45] - - [1, 29] - [1, 47] MACRO_3: name: example-nice string: - [N] - [I] - [C] - [E] type: macro value: - - [1, 49] - - [1, 23] - - [1, 46] - - [1, 18] MEMORY_2: {} openRGB: {} settings: {retryCount: 5, usbDeviceID: 3, usbTimeout: 1000}

Support for G510

Hello, I followed your steps in the README to include the (old) G510 Keyboard.
I pressed all the memory (M-keys), makro (G-keys) and every other non-standard key I could find. The last key was the volume wheel.
Output:

USB ID: 046d:c22d

python3 src/newDeviceDebugger.py:

DEBUG: Searching for keyboard...
DEBUG: Keyboard found! :)
DEBUG: requesting USB endpoint...
DEBUG: HIDraw read endpoint found: /dev/hidraw1
DEBUG: HIDraw disable endpoint found: /dev/hidraw1
DEBUG: HIDraw read endpoint found: /dev/hidraw1
DEBUG: HIDraw disable endpoint found: /dev/hidraw1
DEBUG: Checking for HID availability...
DEBUG: Connected to /dev/hidraw1
INFO: starting listener...
/home/flyingdutchman/PycharmProjects/keyboard-center/src/newDeviceDebugger.py:181: DeprecationWarning: There is no current event loop
  evLoop = asyncio.get_event_loop()
DEBUG: Using selector: EpollSelector
DEBUG: Connection using HIDAPI...
DEBUG: Sending sequence to disable G keys
0: b'\x11\x01\x11\x1a\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
1: b'\x11\x01\n*\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2: b'\x11\x01\x0fZ\x01\x03\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
3: b'\x11\x01\x0f\x1a\x00\x02\x00\x00\x00\x00\x00\x084d\x00\x00\x01\x00\x00\x00'
4: b'\x11\x01\x0f\x1a\x01\x04\x00\x00\x00\x00\x00\x004\x01d\x08\x01\x00\x00\x00'
DEBUG: listening to USB Interface (1, 0) | b'/dev/hidraw1'
got data from keyboard: b'\x03\x00\x00\x10\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00 \x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00@\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x80\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x01\x00\x00\x00'
^[OPgot data from keyboard: b'\x01\x00:\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x02\x00\x00\x00'
^[OQgot data from keyboard: b'\x01\x00;\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x04\x00\x00\x00'
^[ORgot data from keyboard: b'\x01\x00<\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x08\x00\x00\x00'
^[OSgot data from keyboard: b'\x01\x00=\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x10\x00\x00\x00'
^[[15~got data from keyboard: b'\x01\x00>\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03 \x00\x00\x00'
^[[17~got data from keyboard: b'\x01\x00?\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03@\x00\x00\x00'
^[[18~got data from keyboard: b'\x01\x00@\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x80\x00\x00\x00'
^[[19~got data from keyboard: b'\x01\x00A\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x01\x00\x00'
^[[20~got data from keyboard: b'\x01\x00B\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x02\x00\x00'
^[[21~got data from keyboard: b'\x01\x00C\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x04\x00\x00'
got data from keyboard: b'\x01\x00D\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x08\x00\x00'
got data from keyboard: b'\x01\x00E\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x10\x00\x00'
got data from keyboard: b'\x01\x00\x1e\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00 \x00\x00'
got data from keyboard: b'\x01\x00\x1f\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00@\x00\x00'
got data from keyboard: b'\x01\x00 \x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x80\x00\x00'
got data from keyboard: b'\x01\x00!\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x01\x00'
got data from keyboard: b'\x01\x00"\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x02\x00'
got data from keyboard: b'\x01\x00#\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x04\x00'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00 '
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00@'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x01'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x02'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x04'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x08'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x00\x10'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x03\x00\x00\x08\x00'
got data from keyboard: b'\x04\x04'
got data from keyboard: b'\x03\x00\x00\x00\x00'
got data from keyboard: b'\x02\x08'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02\x04'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02\x02'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02\x01'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02\x10'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02 '
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02@'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02@'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x02@'
got data from keyboard: b'\x02\x00'
got data from keyboard: b'\x01\x01\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x01\x01\x06\x00\x00\x00\x00\x00'
^CHIDerrpr: Interrupted system call
got data from keyboard: b'\x01\x01\x00\x00\x00\x00\x00\x00'
got data from keyboard: b'\x01\x00\x00\x00\x00\x00\x00\x00'
INFO: stopping...

python3 src/newDeviceDebugger.py --info:

DEBUG: Searching for keyboard...
DEBUG: Keyboard found! :)
DEBUG: requesting USB endpoint...
###
DEVICE ID 046d:c22d on Bus 005 Address 002 =================
 bLength                :   0x12 (18 bytes)
 bDescriptorType        :    0x1 Device
 bcdUSB                 :  0x200 USB 2.0
 bDeviceClass           :    0x0 Specified at interface
 bDeviceSubClass        :    0x0
 bDeviceProtocol        :    0x0
 bMaxPacketSize0        :    0x8 (8 bytes)
 idVendor               : 0x046d
 idProduct              : 0xc22d
 bcdDevice              :  0x165 Device 1.65
 iManufacturer          :    0x1 Error Accessing String
 iProduct               :    0x2 Error Accessing String
 iSerialNumber          :    0x0 
 bNumConfigurations     :    0x1
  CONFIGURATION 1: 500 mA ==================================
   bLength              :    0x9 (9 bytes)
   bDescriptorType      :    0x2 Configuration
   wTotalLength         :   0x42 (66 bytes)
   bNumInterfaces       :    0x2
   bConfigurationValue  :    0x1
   iConfiguration       :    0x0 
   bmAttributes         :   0xa0 Bus Powered, Remote Wakeup
   bMaxPower            :   0xfa (500 mA)
    INTERFACE 0: Human Interface Device ====================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x0
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x1
     bInterfaceClass    :    0x3 Human Interface Device
     bInterfaceSubClass :    0x1
     bInterfaceProtocol :    0x1
     iInterface         :    0x0 
      ENDPOINT 0x81: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x81 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :    0x8 (8 bytes)
       bInterval        :    0x4
    INTERFACE 1: Human Interface Device ====================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x1
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x2
     bInterfaceClass    :    0x3 Human Interface Device
     bInterfaceSubClass :    0x0
     bInterfaceProtocol :    0x0
     iInterface         :    0x0 
      ENDPOINT 0x82: Interrupt IN ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x82 IN
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :    0x8 (8 bytes)
       bInterval        :    0x4
      ENDPOINT 0x3: Interrupt OUT ==========================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :    0x3 OUT
       bmAttributes     :    0x3 Interrupt
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x4
###

Not working on G910

Hardware:

046d:c32b Logitech, Inc. G910 Orion Spark Mechanical Keyboard

Error Message from keyboard-center:

FATAL ERROR
NO supported keyboard found! :(
(err:None)

HIDpath error

I am getting the following error:

[root] ERROR: 17.05.2023 12:23:27 PM cannot access local variable 'HIDpath' where it is not associated with a value
Traceback (most recent call last):
File "/usr/lib/keyboard-center/main.py", line 52, in
window = MainWindow(app, devmode, not bgmode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/keyboard-center/mainUi.py", line 68, in init
self.initBackgroundService()
File "/usr/lib/keyboard-center/mainUi.py", line 153, in initBackgroundService
self.service = BackgroundService(self.configparser, not self.devmode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/keyboard-center/service.py", line 85, in init
self._initKeyboard()
File "/usr/lib/keyboard-center/service.py", line 126, in _initKeyboard
self._getHIDpaths()
File "/usr/lib/keyboard-center/service.py", line 166, in _getHIDpaths
if HIDpath and not __HIDavailable(HIDpath, numTries):
^^^^^^^
UnboundLocalError: cannot access local variable 'HIDpath' where it is not associated with a value
Traceback (most recent call last):
File "/usr/lib/keyboard-center/main.py", line 52, in
window = MainWindow(app, devmode, not bgmode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/keyboard-center/mainUi.py", line 68, in init
self.initBackgroundService()
File "/usr/lib/keyboard-center/mainUi.py", line 153, in initBackgroundService
self.service = BackgroundService(self.configparser, not self.devmode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/keyboard-center/service.py", line 85, in init
self._initKeyboard()
File "/usr/lib/keyboard-center/service.py", line 126, in _initKeyboard
self._getHIDpaths()
File "/usr/lib/keyboard-center/service.py", line 166, in _getHIDpaths
if HIDpath and not __HIDavailable(HIDpath, numTries):
^^^^^^^
UnboundLocalError: cannot access local variable 'HIDpath' where it is not associated with a value

I have a Logitech G910 keyboard.

Kernel: 6.3.1-zen2-1-zen
DE: Plasma 5.27.5
WM: KWin

Python 3.11.3

keyboard-center not starting, KeyError: 'usbDeviceID'

I'm was trying to start keyboard-center but it wouldn't start up and would show this error:
2022-06-26+T16-01-42

Running it in the terminal gives this error:

[aditeya@nemo ~/.config/keyboard-center]$ keyboard-center
[root] INFO: 26.06.2022 04:01:31 PM ------------ starting -------------
[Configparser] DEBUG: 26.06.2022 04:01:31 pm Config file location: /home/aditeya/.config/keyboard-center/settings.yml
[Configparser] DEBUG: 26.06.2022 04:01:31 pm loading config file /home/aditeya/.config/keyboard-center/settings.yml
[Configparser] DEBUG: 26.06.2022 04:01:31 pm config loaded: {'mappings': {'MEMORY_1': {'MACRO_1': {'name': 'example-A', 'string': 'A', 'type': 'key', 'value': [1, 30]}, 'MACRO_2': {'name': 'example-cut', 'string': [['Ctrl', 'X'], ['Ctrl', 'V']], 'type': 'macro', 'value': [[[1, 29], [1, 45]], [[1, 29], [1, 47]]]}, 'MACRO_3': {'name': 'example-nice', 'string': [['N'], ['I'], ['C'], ['E']], 'type': 'macro', 'value': [[[1, 49]], [[1, 23]], [[1, 46]], [[1, 18]]]}}}, 'settings': {'usbTimeout': 1000, 'retryCount': 5}}
[BGService] INFO: 26.06.2022 04:01:31 pm setting up service...
[BGService] INFO: 26.06.2022 04:01:31 pm searching for supported keyboard...
[BGService] INFO: 26.06.2022 04:01:31 pm keyboard found: Logitech G815
[Configparser] DEBUG: 26.06.2022 04:01:31 pm setting deviceID to 3
[root] ERROR: 26.06.2022 04:01:44 pm 'usbDeviceID'
Traceback (most recent call last):
  File "/usr/lib/keyboard-center/main.py", line 55, in <module>
    window = MainWindow(app, devmode)
  File "/usr/lib/keyboard-center/mainUi.py", line 140, in __init__
    self.initBackgroundService()
  File "/usr/lib/keyboard-center/mainUi.py", line 230, in initBackgroundService
    service = BackgroundService(self.configparser)
  File "/usr/lib/keyboard-center/service.py", line 89, in __init__
    self._initKeyboard()
  File "/usr/lib/keyboard-center/service.py", line 103, in _initKeyboard
    self.config.setAndSaveDeviceID(i)
  File "/usr/lib/keyboard-center/lib/configparser.py", line 142, in setAndSaveDeviceID
    if self.getDeviceID() != id:
  File "/usr/lib/keyboard-center/lib/configparser.py", line 80, in getDeviceID
    return self.getSettings()["usbDeviceID"]
KeyError: 'usbDeviceID'
Traceback (most recent call last):
  File "/usr/lib/keyboard-center/main.py", line 55, in <module>
    window = MainWindow(app, devmode)
  File "/usr/lib/keyboard-center/mainUi.py", line 140, in __init__
    self.initBackgroundService()
  File "/usr/lib/keyboard-center/mainUi.py", line 230, in initBackgroundService
    service = BackgroundService(self.configparser)
  File "/usr/lib/keyboard-center/service.py", line 89, in __init__
    self._initKeyboard()
  File "/usr/lib/keyboard-center/service.py", line 103, in _initKeyboard
    self.config.setAndSaveDeviceID(i)
  File "/usr/lib/keyboard-center/lib/configparser.py", line 142, in setAndSaveDeviceID
    if self.getDeviceID() != id:
  File "/usr/lib/keyboard-center/lib/configparser.py", line 80, in getDeviceID
    return self.getSettings()["usbDeviceID"]
KeyError: 'usbDeviceID'

This error showed up after I tried resetting the config. I did the reset because the application wasn't working and if I try to start it, a transparent window just opens.

EDIT: forgot to mention, I updated it yesterday

TypeError: can only concatenate str

Hi, I just updated to 1.0.3-1 (Manjaro) and when opening keyboard center, I get the following error message:

keyboard-center
Traceback (most recent call last):
  File "/usr/lib/keyboard-center/main.py", line 8, in <module>
    from mainUi import MainWindow
  File "/usr/lib/keyboard-center/mainUi.py", line 23, in <module>
    from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface
  File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in <module>
    import uinput
  File "/usr/lib/python3.11/site-packages/uinput/__init__.py", line 86, in <module>
    _libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("SO")))
                                                                                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Maybe another package got updated too? I just ran system updates..

Numpad keys on G815 can't be added to macro.

If I try to add a key, from the numpad, on to the macro input box, nothing happens. It accepts NumLock but won't accept any keys from the numpad. I'm running this on Arch Linux with the bspwm TWM.

Keyboard Center crashes on single key on G-Keys

Found the following problem:
If I don't put a key combination in the GUI of the Keyboard-Center, but only a single key on the G-keys, the GUI crashes. I can restart the GUI afterwards, but if I select the profile of the G-key, on which I placed a single key before, the Keyboard-Center crashes again immediately. I can only remove the key via settings.yml and then use the keyboard center again without restrictions. All other G-Keys still work, but the single key does not.
When the GUI crashes, the following error message appears when I start the keyboard center via the console:

Traceback (most recent call last):
  File "/usr/lib/keyboard-center/main.py", line 241, in setCurrMacro
    if load: self.loadData()
  File "/usr/lib/keyboard-center/main.py", line 279, in loadData
    d, orgb = self.configparser.loadForGui(
  File "/usr/lib/keyboard-center/lib/configparser.py", line 138, in loadForGui
    return ConfigEntry.fromConfig(data), openRGB
  File "/usr/lib/keyboard-center/lib/configtypes.py", line 68, in fromConfig
    if name: result.name = name
AttributeError: 'NoneType' object has no attribute 'name'
/usr/bin/keyboard-center: Zeile 3:  2551 Abgebrochen           python3 /usr/lib/keyboard-center/main.py "$@"

can't set alt-tab

Hi,
I'm trying to create a macro that contains ALT+tab but when I press tab in the "press shortcut" field or "custom modifier" field it switches away to the next GUI element instead of registering that I pressed tab.
Can you help me solve this?
I'm on a G710+

stopped working on Garuda Linux a couple weeks ago

No errors shown. The window tries to appear for a moment then disappears without ending up in the tray.

I have a Logitech G910 keyboard.

Kernel: 6.3.1-zen2-1-zen
DE: Plasma 5.27.5
WM: KWin

Python 3.11.3

if I run "keyboard-center" from the terminal, I see this:

Traceback (most recent call last):
File "/usr/lib/keyboard-center/main.py", line 8, in
from mainUi import MainWindow
File "/usr/lib/keyboard-center/mainUi.py", line 23, in
from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface
File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in
import uinput
File "/usr/lib/python3.11/site-packages/python_uinput-0.11.2-py3.11-linux-x86_64.egg/uinput/init.py", line 86, in
_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(file), "..", "_libsuinput" + sysconfig.get_config_var("SO")))
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

please add a way to donate

After suffering a couple of weeks without this app, telling myself that I could learn to live without my G910 keys. And that I will sooner or later have to, and now is the time....

I finally asked here about a fix and within HOURS I had a response. And it feels so GOOD to have my keys back.

I'd love to be able to "buy you a coffee" or whatever you want to call it.

Project blocks RGB support

I would like to say that I have been very pleased with this project, as it's been a great way to assign macros for this board.

However, I did notice that with this project installed, RGB support seems to be completely blocked. I tried both the OpenRGB and keyleds projects, which worked fine without this package, but when enabled neither are able to provide RGB support, OpenRGB is unable to even detect the keyboard.

Using Super Key as Custom Modifier Deletes All Settings

First of all, excellent project. It works great, and having this work nicely with OpenRGB makes for a seamless solution for complete control over my devices that is actually better in terms of quality and feature set than the official, bloated, Windows-only "software".

Here's the bug I found:
Attempting to use the super (Windows) key as a custom modifier for a macro results in the settings.yml file being completely deleted.

Using Debian Bookworm and i3 (with GNOME installed as well), keyboard-center version 1.0.5.

I don't know if this has anything to do with it, but I have a Logitech G815 keyboard.

image

Fedora Install

Would it be possible to get install instructions for Fedora, an AppImage, or an rpm package? Thank you.

Software crashing on start on Manjaro

I'm not sure what changed, perhaps python was updated on my system, but keyboard center is no longer starting and I'm getting the following error.

❯ keyboard-center

Traceback (most recent call last):

  File "/usr/lib/keyboard-center/main.py", line 8, in <module>

    from mainUi import MainWindow

  File "/usr/lib/keyboard-center/mainUi.py", line 23, in <module>

    from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface

  File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in <module>

    import uinput

  File "/usr/lib/python3.11/site-packages/uinput/__init__.py", line 86, in <module>

    _libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "_libsuinput" + sysconfig.get_config_var("SO")))

                                                                                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TypeError: can only concatenate str (not "NoneType") to str

Any suggestions ?
Thank you!

ability to send modifiers by themselves

Hi again, sorry to be annoying. :D
I'm using virt-manager and want to quickly alt tab to another program on the host.
To release the focus from the guest I'd need to send L_CTRL+L_ALT without anything else (followed by ALT+TAB of course but that works perfectly now).
Currently keyboard-center when saving throws the error "No key assigned!".
Maybe it would it be possible if you made that just an ignorable warning?

Service starting to fast??? Maybe?

I Had to add a 10 sec delay at start up for keyboard central .service file to detect my g910 keyboard. I'm running manjaro latest (as of time of post) was wondering if that delay should be standard to prevent any problems? Or I accept that fact that my setup is configured wrong. Just a thought ( I know I uninstalled programs that didn't work right off the bat when I started linux)

add support for G915

I am trying to setup a Logitech G915 Lightspeed keyboard. When I run newDeviceDebugger, it ends of failing and hanging, and the keyboard becomes non-operational until the wireless usb adapter is removed and reinserted. I believe it is a problem with the disableGKeys line, the byte code provided in the script for the G910 does not work, and I do not know where to find the proper code to add to the script. Below the terminal output from running newDeviceDebugger:

sudo python3 src/newDeviceDebugger.py

DEBUG: Searching for keyboard...
DEBUG: Keyboard found! :)
DEBUG: requesting USB endpoint...
DEBUG: check and detach kernel driver if active
INFO: starting service...
/home/brandon/Desktop/keyboard-center/src/newDeviceDebugger.py:122: DeprecationWarning: There is no current event loop
evLoop = asyncio.get_event_loop()
DEBUG: Using selector: EpollSelector
DEBUG: Connection using HIDAPI...
DEBUG: Sending sequence to disable G keys
ERROR: Task exception was never retrieved
future: <Task finished name='Task-1' coro=<usbListener() done, defined at /home/brandon/Desktop/keyboard-center/src/newDeviceDebugger.py:48> exception=HIDException('Broken pipe')>
Traceback (most recent call last):
File "/home/brandon/Desktop/keyboard-center/src/newDeviceDebugger.py", line 58, in usbListener
await disableGkeyMapping(disableGKeys)
File "/home/brandon/Desktop/keyboard-center/src/newDeviceDebugger.py", line 45, in disableGkeyMapping
hdev.write(data)
File "/home/brandon/Desktop/keyboard-center/src/lib/hid.py", line 163, in write
return self.__hidcall(hidapi.hid_write, self.__dev, data, len(data))
File "/home/brandon/Desktop/keyboard-center/src/lib/hid.py", line 154, in __hidcall
raise HIDException(err)
lib.hid.HIDException: Broken pipe

ModuleNotFoundError: No module named 'lib.configparser'

Distribution:
Arch Linux

Installation method:
Via https://aur.archlinux.org/packages/keyboard-center/

Python Version
Python 3.9.6

Issue
Installation of the package runs correctly, but when I attempt to start it I get the error -

Traceback (most recent call last):
  File "/usr/lib/keyboard-center/main.py", line 13, in <module>
    from lib.configparser import Configparser
ModuleNotFoundError: No module named 'lib.configparser'

I'm not familiar with lib.configparser, but it wasn't a valid import on any system I tried.

Arch update broke the 'uinput'

Hi,
Not sure what did break the system (new Python update?), but I have some logs to share. I hope they will be helpful to understand.

System:

  • Arch, 6.3.1-zen1-1-zen
  • Python 3.11.3
  • Keyboard G910

05.05.2023 05:52 systemd Started Keyboard Center.
05.05.2023 05:52 plasmashell Traceback (most recent call last):
05.05.2023 05:52 plasmashell File "/usr/lib/keyboard-center/main.py", line 8, in
05.05.2023 05:52 plasmashell from mainUi import MainWindow
05.05.2023 05:52 plasmashell File "/usr/lib/keyboard-center/mainUi.py", line 23, in
05.05.2023 05:52 plasmashell from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface
05.05.2023 05:52 plasmashell File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in
05.05.2023 05:52 plasmashell import uinput
05.05.2023 05:52 plasmashell ModuleNotFoundError: No module named 'uinput'

So I see that 'uinput' module is not found.
I've tried to install it via: pip install python-uinput

And here's the log after that:
05.05.2023 05:55 systemd Started Keyboard Center.
05.05.2023 05:55 plasmashell Traceback (most recent call last):
05.05.2023 05:55 plasmashell File "/usr/lib/keyboard-center/main.py", line 8, in
05.05.2023 05:55 plasmashell from mainUi import MainWindow
05.05.2023 05:55 plasmashell File "/usr/lib/keyboard-center/mainUi.py", line 23, in
05.05.2023 05:55 plasmashell from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface
05.05.2023 05:55 plasmashell File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in
05.05.2023 05:55 plasmashell import uinput
05.05.2023 05:55 plasmashell File "/home/jk/.local/lib/python3.11/site-packages/uinput/init.py", line 86, in
05.05.2023 05:55 plasmashell _libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(file), "..", "_libsuinput" + sysconfig.get_config_var("SO")))
05.05.2023 05:55 plasmashell ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
05.05.2023 05:55 plasmashell TypeError: can only concatenate str (not "NoneType") to str

At this stage, my *nix knowledge is over. Let me know if I can help somehow.
But for now, it's a great time for a timemachine. :-)

Thanks, lesu1

Service fails to start with ModuleNotFoundError for openrgb

Just updated to 0.1.18-testing. Service seems to be failing due to openrgb not being found:

Oct 01 18:00:26 AL-PC systemd[577]: Started background service for the Keyboard-Center application.
Oct 01 18:00:26 AL-PC python3[586]: Traceback (most recent call last):
Oct 01 18:00:26 AL-PC python3[586]:   File "/usr/lib/keyboard-center/service.py", line 23, in <module>
Oct 01 18:00:26 AL-PC python3[586]:     from lib.openrgb.orgb import OpenRGBClient
Oct 01 18:00:26 AL-PC python3[586]:   File "/usr/lib/keyboard-center/lib/openrgb/__init__.py", line 3, in <module>
Oct 01 18:00:26 AL-PC python3[586]:     from openrgb import utils
Oct 01 18:00:26 AL-PC python3[586]: ModuleNotFoundError: No module named 'openrgb'
Oct 01 18:00:26 AL-PC systemd[577]: keyboard-center.service: Main process exited, code=exited, status=1/FAILURE
Oct 01 18:00:26 AL-PC systemd[577]: keyboard-center.service: Failed with result 'exit-code'.

This was checked after I had restarted the service, and rebooting the system does not fix the issue. OpenRGB is not installed.

G935 support

I am trying to get output from a G935.
G935 is a headset that has buttons on the side which can be remapped in the Logitech software just like any other G-Key.

Unfortunately the newDeviceDebugger just throws an error:

usbVendor = 0x046d
usbProduct = 0x0a87
DEBUG: Searching for keyboard...
DEBUG: Keyboard found! :)
DEBUG: requesting USB endpoint...
Traceback (most recent call last):
  File "/tmp//keyboard-center/src/newDeviceDebugger.py", line 222, in <module>
    main()
  File "/tmp//keyboard-center/src/newDeviceDebugger.py", line 183, in main
    keyboardEndpoint: core.Endpoint = keyboard\
                                      ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/usb/core.py", line 534, in __getitem__
    return Endpoint(
           ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/usb/core.py", line 347, in __init__
    desc = backend.get_endpoint_descriptor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/usb/backend/libusb1.py", line 798, in get_endpoint_descriptor
    ep_desc = i.endpoint[ep]
              ~~~~~~~~~~^^^^
ValueError: NULL pointer access

same output for --info
I also tested with my G815 which works without issues.

To me it seems like the G935 connects just like a keyboard since volume up and volume down "keypresses" are correctly being recognized in other software

Event: time 1690496964.584296, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00ea
Event: time 1690496964.584296, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1690496964.584296, -------------- SYN_REPORT ------------
Event: time 1690496964.783341, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00ea
Event: time 1690496964.783341, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1690496964.783341, -------------- SYN_REPORT ------------
Event: time 1690496965.985354, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
Event: time 1690496965.985354, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1690496965.985354, -------------- SYN_REPORT ------------
Event: time 1690496966.134346, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
Event: time 1690496966.134346, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1690496966.134346, -------------- SYN_REPORT ------------

keyboard-center.service did not install on Linux Mint 20.3

Stopped the service, uninstalled 1.28.1 (very old) then ran: apt install keyboard-center_0.2.8-1_amd64.deb

Running systemctl --user start keyboard-center.service caused an error of not found.

Copied the service to /lib/systemd/user/ from source and then it worked.

Upgrade instructions would be useful.

Feature Request: Cycle Commands

  1. press key
  2. 1st command executes
  3. press key again
  4. 2nd command executes
  5. press key again
  6. 1st command executes
    ... and so on

Maybe like a checkbox or something

Cannot make it work on Linux Mint 20.3 64-bit

Installed OpenRGB, all the dependencies, then the .deb of keyboard-center_0.1.24-1_amd64.deb on a fresh install of Mint 20.3 with a Logitech G910 Orion Spectrum keyboard.

The GUI comes up and I can define keys and see them in settings.yml. Get notifications, and systemctl status says:

● keyboard-center.service - background service for the Keyboard-Center application
     Loaded: loaded (/usr/lib/systemd/user/keyboard-center.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-01-17 22:25:47 MST; 6h left
   Main PID: 2009 (python3)
     CGroup: /user.slice/user-1000.slice/[email protected]/keyboard-center.service
             └─2009 /usr/bin/python3 /usr/lib/keyboard-center/service.py /home/trh

Jan 17 22:25:48 clavius python3[2009]: DEBUG: requesting USB endpoint...
Jan 17 22:25:48 clavius python3[2009]: DEBUG: Searching for HIDraw endpoint...
Jan 17 22:25:48 clavius python3[2009]: DEBUG: HIDraw disable endpoint found: /dev/hidraw2
Jan 17 22:25:48 clavius python3[2009]: DEBUG: HIDraw read endpoint found: /dev/hidraw3
Jan 17 22:25:48 clavius python3[2009]: DEBUG: Checking for HID availability...
Jan 17 22:25:48 clavius python3[2009]: DEBUG: Connected to /dev/hidraw3
Jan 17 22:25:48 clavius python3[2009]: DEBUG: creating uinput device...
Jan 17 22:25:48 clavius python3[2009]: INFO: starting service...
Jan 17 22:25:48 clavius python3[2009]: DEBUG: Using selector: EpollSelector
Jan 17 22:25:48 clavius python3[2009]: DEBUG: Sending sequence to disable G keys

Note the last line that is disabling G keys. Odd that. But most of the G keys generate a tilde ~ and not as defined.

Have checked everything I know to, rebooted, etc. but no joy.

Nice software and idea. I'm a software engineer but not into Python. Will help however I can.

Installation in OpenSuse Tumbleweed

I have currently not found a way to fully run this program in Opensuse Tumbleweed.
Would it be possible to add support for OpenSuse TW?

I have currently tried running src/main.py with the required dependencies installed, the rgb changes to rainbow fade, and the keys does seem to be detected. (not shown in console output, but it definitely does work)
However the GUI never appears

OS: OpenSuse Tumbleweed
Keyboard: G910 orion spark
python 3.10.9

 ~/Documents/tests/keyboard-center   master  python3 src/main.py
[root] INFO: 01.02.2023 11:27:27  ------------ starting -------------
[Configparser] DEBUG: 01.02.2023 11:27:27  Config file location: /home/XXXX/.config/keyboard-center/settings.yml
[Configparser] DEBUG: 01.02.2023 11:27:27  loading config file /home/XXXX/.config/keyboard-center/settings.yml
[Configparser] DEBUG: 01.02.2023 11:27:27  config loaded: {'mappings': {'MEMORY_1': {'MACRO_1': {'name': 'example-A', 'string': 'A', 'type': 'key', 'value': [1, 30]}, 'MACRO_2': {'name': 'example-cut', 'string': [['Ctrl', 'X'], ['Ctrl', 'V']], 'type': 'macro', 'value': [[[1, 29], [1, 45]], [[1, 29], [1, 47]]]}, 'MACRO_3': {'name': 'example-nice', 'string': [['N'], ['I'], ['C'], ['E']], 'type': 'macro', 'value': [[[1, 49]], [[1, 23]], [[1, 46]], [[1, 18]]]}}}, 'settings': {'retryCount': 5, 'usbDeviceID': 2, 'usbTimeout': 1000}}
[BGService] INFO: 01.02.2023 11:27:27  setting up service...
[BGService] INFO: 01.02.2023 11:27:27  searching for supported keyboard...
[BGService] INFO: 01.02.2023 11:27:27  keyboard found: Logitech G910 Orion Spark
[Configparser] DEBUG: 01.02.2023 11:27:27  setting deviceID to 2
[BGService] DEBUG: 01.02.2023 11:27:27  time taken to find keyboard in ms: 42.72031784057617
[BGService] DEBUG: 01.02.2023 11:27:27  requesting USB endpoint...
[BGService] DEBUG: 01.02.2023 11:27:27  searching HIDpaths...
[BGService] DEBUG: 01.02.2023 11:27:27  HIDraw write endpoint found: /dev/hidraw0
[BGService] DEBUG: 01.02.2023 11:27:27  HIDraw read endpoint found: /dev/hidraw1
[BGService] DEBUG: 01.02.2023 11:27:27  HIDraw read endpoint found: /dev/hidraw1
[BGService] DEBUG: 01.02.2023 11:27:27  HIDraw read endpoint found: /dev/hidraw1
[BGService] DEBUG: 01.02.2023 11:27:27  HIDraw read endpoint found: /dev/hidraw1
[BGService] DEBUG: 01.02.2023 11:27:27  Checking for HID availability...
[BGService] DEBUG: 01.02.2023 11:27:27  Connected to /dev/hidraw1
[BGService] DEBUG: 01.02.2023 11:27:27  creating uinput device
[QT] DEBUG: 01.02.2023 11:27:27  start health check...
[BGService] INFO: 01.02.2023 11:27:27  starting service loop...
[BGService] DEBUG: 01.02.2023 11:27:27  Sending sequence to disable G keys
[QT] DEBUG: 01.02.2023 11:27:27  setting up GUI...
[Configparser] DEBUG: 01.02.2023 11:27:27  loading config file /home/XXXX/.config/keyboard-center/settings.yml
[Configparser] DEBUG: 01.02.2023 11:27:27  config loaded: {'mappings': {'MEMORY_1': {'MACRO_1': {'name': 'example-A', 'string': 'A', 'type': 'key', 'value': [1, 30]}, 'MACRO_2': {'name': 'example-cut', 'string': [['Ctrl', 'X'], ['Ctrl', 'V']], 'type': 'macro', 'value': [[[1, 29], [1, 45]], [[1, 29], [1, 47]]]}, 'MACRO_3': {'name': 'example-nice', 'string': [['N'], ['I'], ['C'], ['E']], 'type': 'macro', 'value': [[[1, 49]], [[1, 23]], [[1, 46]], [[1, 18]]]}}}, 'settings': {'retryCount': 5, 'usbDeviceID': 2, 'usbTimeout': 1000}}
loading 0 0
AAAAA Key: name <example-A>, type <key>, string <['A']>, value <[(1, 30)]> example-A 

G815 Data

Bus 001 Device 003: ID 046d:c33f Logitech, Inc. G815 RGB MECHANICAL GAMING KEYBOARD
G815info.txt
G815capture.txt

Keypress sequence was M1 M2 M3 MR Game-Mode G1 G2 G3 G4 G5 REW PLAY/PAUSE FF MUTE VOL- VOL+

Crashes on Start under Arch

When launching from terminal I get these errors:
Icon theme "gnome" not found.
service enabled?
service running?
starting service...
service needs reload?
Traceback (most recent call last):
File "/usr/lib/keyboard-center/main.py", line 150, in readConfiguration
_did = self.configparser.getSettings()["usbDeviceID"]
File "/usr/lib/keyboard-center/lib/configparser.py", line 50, in getSettings
return self.settings["settings"]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/keyboard-center/main.py", line 374, in
main()
File "/usr/lib/keyboard-center/main.py", line 367, in main
window = MainWindow(app, devmode)
File "/usr/lib/keyboard-center/main.py", line 118, in init
self.readConfiguration()
File "/usr/lib/keyboard-center/main.py", line 154, in readConfiguration
f"No supported keyboard found! :(\n(err:{_did})",
UnboundLocalError: local variable '_did' referenced before assignment

Service exits with error on G910

Running this software on a relatively new install of EndeavourOS with a G910 Orion Spectrum. lsusb shows ID 046d:c335 Logitech, Inc. G910 Orion Spectrum Mechanical Keyboard

After installing for the first time, everything worked fine until the next boot, in which my gkeys and mkeys stopped being recognized. This seems to have something to do with keyboard-center.service failing every time the software launches. Running systemctl --user status keyboard-center.service produces the following output:

Sep 26 15:35:42 AL-PC python3[3522]:     virtualKeyboard = uinput.Device(
Sep 26 15:35:42 AL-PC python3[3522]:   File "/usr/lib/python3.9/site-packages/uinput/__init__.py", line 178, in __init__
Sep 26 15:35:42 AL-PC python3[3522]:     self.__uinput_fd = fd or fdopen()
Sep 26 15:35:42 AL-PC python3[3522]:   File "/usr/lib/python3.9/site-packages/uinput/__init__.py", line 84, in fdopen
Sep 26 15:35:42 AL-PC python3[3522]:     return _libsuinput.suinput_open()
Sep 26 15:35:42 AL-PC python3[3522]:   File "/usr/lib/python3.9/site-packages/uinput/__init__.py", line 70, in _open_error_handler
Sep 26 15:35:42 AL-PC python3[3522]:     raise OSError(code, msg)
Sep 26 14:41:57 AL-PC python3[586]: OSError: [Errno 19] Failed to open the uinput device: No such device
Sep 26 15:35:42 AL-PC systemd[577]: keyboard-center.service: Main process exited, code=exited, status=1/FAILURE
Sep 26 15:35:42 AL-PC systemd[577]: keyboard-center.service: Failed with result 'exit-code'.

Some things I have tried to no avail include:

  • Reinstalling. The service started working again after the first install, but stopped working again after a restart. The next ~5 installs could not reproduce this, and I have not been able to get a successful service start since the first reinstall.
  • modprobe uinput changes the service status output on one line, from OSError: [Errno 19] Failed to open the uinput device: No such device to PermissionError: [Errno 13] Failed to open the uinput device: Permission denied. The service fails either way.

Keyboard Center Fails to Launch.

I try to launch Keyboard Center with the command "keyboard-center %f " and this is the error that I got below

Traceback (most recent call last):
File "/usr/lib/keyboard-center/main.py", line 8, in
from mainUi import MainWindow
File "/usr/lib/keyboard-center/mainUi.py", line 23, in
from devices.keyboard import SUPPORTED_DEVICES, KeyboardInterface
File "/usr/lib/keyboard-center/devices/keyboard.py", line 1, in
import uinput
File "/usr/lib/python3.11/site-packages/uinput/init.py", line 86, in
_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(file), "..", "_libsuinput" + sysconfig.get_config_var("SO")))
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Im running.

OS: Manjaro 23.0.0 UltimaThule
Kernel: x86_64 Linux 5.15.114-2-MANJARO
Shell: zsh 5.9
Resolution: 5360x1440
DE: KDE 5.106.0 / Plasma 5.27.5
WM: KWin
Disk: 8.3T / 14T (64%)
CPU: AMD Ryzen 5 5600X 6-Core @ 12x 3.693GHz
GPU: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] (rev c1)
RAM: 4211MiB / 64208MiB ]
The keyboard is a Logitech G910

I guess this goes back to Issue #42 Changed /usr/lib/python3.11/site-packages/uinput/init.py Line 86 from _libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(file), "..", "_libsuinput" + sysconfig.get_config_var("SO")))

to

_libsuinput_path = os.path.abspath(os.path.join(os.path.dirname(file), "..", "_libsuinput" + sysconfig.get_config_var("EXT_SUFFIX")))

now its working again.

[Documentation] Icon Tinkering for i3 Users

I don't think this is a keyboard-center bug, but rather a recommended tweak for i3 users. This is an environment issue I found and I'll share how I got around it.

If you use i3, you might notice that the icons for the UI buttons are missing. This can make it a little difficult to use the GUI.

I have GNOME installed on my machine, and when running keyboard-center within GDM there's no issue: The icons show up fine.

I haven't dug into the code, but I think that the reason this happens is because depending on the desktop environment, the GUI library tries to choose appropriate, built-in icons. For i3, it seems there are none by default (which is technically true: i3 alone does not include any icons). Again, this is only speculation on my part.

In order to use the GNOME icons while running keyboard-center in i3, I set the XDG_SESSION_DESKTOP AND XDG_CURRENT_DESKTOP variables for the execution of keyboard-center only.

Here's how to do that:
XDG_SESSION_DESKTOP=GNOME XDG_CURRENT_DESKTOP=GNOME /usr/bin/keyboard-center

If you have KDE or something else installed and want to do something similar, you can find what vars should be set using env | grep XDG to see what those vars should be when running in i3.

Ability to hold down G-keys

Currently, pressing a G-key will always trigger its respective macro, which means that even if there is one key assigned, it's treated as a quick press rather than staying held down until the user releases the key, making holding down G-keys not possible. Is this feature something that might be planned for the future?

Add option to disable notifications

I sometimes switch profiles often and the notification tool in Linux stacks-up each change. That makes notifications from other software less useful, such as a new email from Thunderbird.

It would be helpful to have an option to disable Keyboard Center notification of profile changes.

This is a relatively low priority and just a suggestion.

Thanks for the great software.

openRGB process not closing on exit

hey
hope all is well.
is it possible to kill the openrgb process then executing again after restarting keyboard center...
maybe giving a few seconds delay between the two.
it will help fix my issue when my laptop wakes up and I need to do this process manually in order to get it to work,

thank you !!

Shortcuts without Meta, Alt, Ctrl or Shift

Maybe I just can't find the option, but in my opinion the option to create shortcuts that don't start with Meta, Alt, Ctrl or Shift is missing. For example, you can't put F3+N as a key combination on a G-key.
Would be a useful extension in my opinion.

Feature Request | Modifier ALT GR

If I want to add the modifier AltGr as a custom modifier nothing happens. Every other modifier works without any issues.
So it would be nice to have the option to use AltGr as a custom modifier.

'Unable to open device' upon log in

Most of the times when I log into my computer upon rebooting, keyboard-center does not immediately function. Upon running systemctl --user status keyboard-center, the process has crashed with the following errors, possibly due to the process attempting to initialize before the keyboard is ready:

Sep 16 22:35:28 mars python3[1187]: ERROR: Task exception was never retrieved
Sep 16 22:35:28 mars python3[1187]: future: <Task finished name='Task-1' coro=<usbListener() done, defined at /usr/lib/keyboard-center/service.py:141> exception=HIDException('unable to open device')>
Sep 16 22:35:28 mars python3[1187]: Traceback (most recent call last):
Sep 16 22:35:28 mars python3[1187]:   File "/usr/lib/keyboard-center/service.py", line 153, in usbListener
Sep 16 22:35:28 mars python3[1187]:     await disableGkeyMapping(keyboardDev, HIDpath_disable)
Sep 16 22:35:28 mars python3[1187]:   File "/usr/lib/keyboard-center/service.py", line 53, in disableGkeyMapping
Sep 16 22:35:28 mars python3[1187]:     with HIDDevice(path=HIDpath) as hdev:
Sep 16 22:35:28 mars python3[1187]:   File "/usr/lib/keyboard-center/lib/hid.py", line 136, in __init__
Sep 16 22:35:28 mars python3[1187]:     raise HIDException('unable to open device')
Sep 16 22:35:28 mars python3[1187]: lib.hid.HIDException: unable to open device

Running systemctl --user restart keyboard-center is a workaround which allows the program to then function as intended.

Ability to hide tray icon

Feature request to hide tray icon

The idea I have is to pass a flag like '--hide-tray-icon' or '--daemon-mode'. This flag would just run the program as a daemon and wouldn't launch any GUI or tray icon. Any instance thats started after wouldn't start because it'll check to see if the daemon is running. This way you can avoid multiple processes being spawned.

It can be a setting advertised in the help menu or the README for power users who'd like to hide it. Additionally if anyone wants to change the settings, they can:

  1. kill the process
  2. start keyboard-center normally
  3. do their changes
  4. Start with the flag

Trying to record Key Mappings for Logitech G613

For some reason when I enter lsusb my keyboard shows up as Logitech G631, but it actually is a Logitech G613?

But the main issue is when I run the script python3 src/newDeviceDebugger.py the below is output

DEBUG: Searching for keyboard...
DEBUG: Keyboard found! :)
DEBUG: requesting USB endpoint...
DEBUG: HIDraw read endpoint found: /dev/hidraw5
DEBUG: HIDraw disable endpoint found: /dev/hidraw5
DEBUG: HIDraw read endpoint found: /dev/hidraw5
DEBUG: HIDraw disable endpoint found: /dev/hidraw5
DEBUG: HIDraw read endpoint found: /dev/hidraw5
DEBUG: HIDraw disable endpoint found: /dev/hidraw5
DEBUG: HIDraw read endpoint found: /dev/hidraw5
DEBUG: HIDraw disable endpoint found: /dev/hidraw5
DEBUG: HIDraw read endpoint found: /dev/hidraw5
DEBUG: HIDraw disable endpoint found: /dev/hidraw5
DEBUG: Checking for HID availability...
DEBUG: Connected to /dev/hidraw5
INFO: starting listener...
DEBUG: Using selector: EpollSelector
DEBUG: listening to USB Interface (1, 0) | b'/dev/hidraw5'

Then when I press G1 I get ^[OP which is the same as when I press F1. Similar for G2 I get ^[OQ which is the same as F2 and so on. What do I need to do to separate out the G keys from the F keys so I can record?

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.