Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug, Feature request] Wayland support #104

Closed
ldrahnik opened this issue Mar 9, 2023 · 41 comments
Closed

[Bug, Feature request] Wayland support #104

ldrahnik opened this issue Mar 9, 2023 · 41 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request refactoring

Comments

@ldrahnik
Copy link
Member

ldrahnik commented Mar 9, 2023

  1. Feature "NumberPad will be immediately disabled when is disabled Touchpad": atm is not Wayland supported, mentioned error in log (executing of xinput is in try catch block, should not stop the driver from working), max 9 times is executed xinput, then will be feature (and of course executing xinput) disabled.

  2. What is equivalent for this command for wayland: cmd = ["xinput", "set-prop", touchpad_name, 'libinput Tapping Enabled', str(value)]

  3. How to get remapped keys in Wayland. For example install French keyboard. I installed French Bepo. Atm is implemented:

import Xlib.display
import Xlib.X
import Xlib.XK
def get_keycode_of_ascii_char(char):
    display = Xlib.display.Display()
    keysym = Xlib.XK.string_to_keysym(char)
    keycode = display.keysym_to_keycode(keysym) - 8
    return keycode

On French keyboard has to be Unicode character send via not SHIFT, LEFT CTRL, U + numbers but SHIFT, LEFT CTRL, S + numbers. Does it works under Wayland? Or what should be used? In case the same way works check can be: print character in layout "%" using French keyboard layout enabled.

==========================================================

TODO:

Keep updated inside the pull request.

@ldrahnik ldrahnik added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Mar 9, 2023
@ldrahnik ldrahnik self-assigned this Mar 9, 2023
@ldrahnik ldrahnik changed the title Wayland support [Bug, Feature request] Wayland support Mar 9, 2023
ldrahnik added a commit that referenced this issue Mar 17, 2023
… status of Touchpad / setting up tab-to-click
@ldrahnik ldrahnik removed the bug Something isn't working label Mar 19, 2023
@kamack38 kamack38 mentioned this issue Apr 20, 2023
@ldrahnik ldrahnik added the bug Something isn't working label Jun 29, 2023
@ldrahnik ldrahnik removed the bug Something isn't working label Jul 26, 2023
@Sporknife
Copy link

Works for me.

@ldrahnik
Copy link
Member Author

ldrahnik commented Jan 7, 2024

@Sporknife Could you be more explicit, please?

@Sporknife
Copy link

Sporknife commented Jan 7, 2024

The numpad on the touchpad feature works on wayland on my machine.

Operating System: openSUSE Tumbleweed 20240106
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12
Kernel Version: 6.6.9-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: Zenbook UN5401QAB_UN5401QA
System Version: 1.0

@ldrahnik
Copy link
Member Author

ldrahnik commented Jan 7, 2024

@Sporknife Do you mean point 3? Please try to install the French keyboard and unicode NumberPad layout and let me know whether works "%" and others, thank you.

@Sporknife
Copy link

wdym by "unicode NumberPad"?

@ldrahnik
Copy link
Member Author

ldrahnik commented Jan 7, 2024

@Sporknife Select during installing layout with -unicode in the end, so keys are sent via the shortcut for Unicode characters (left shift + left ctrl + U (on French keyboard it is V and that is the problem on Wayland I guess) and numbers.

@ldrahnik
Copy link
Member Author

ldrahnik commented Jan 8, 2024

@Sporknife Result?

@Sporknife
Copy link

@ldrahnik Can you walk me through the steps? From what I've understood they go like this.

  1. bash install.sh -unicode
  2. Change keyboard to french
  3. Test if it works.

@ldrahnik
Copy link
Member Author

ldrahnik commented Jan 8, 2024

@Sporknife Do not accept recommended layout during install process, answer N during and then pick up your NumberPad layout with -unicode in the end

@ldrahnik
Copy link
Member Author

@Sporknife ping

@ldrahnik ldrahnik added the bug Something isn't working label Jan 22, 2024
@adamant-pwn
Copy link

I'm using Hyprland on Arch Linux.

Installing this as a global service via asus-numberpad-driver-gx551-git fails for some reason, even if I try to do it in tty (similar to #144). However, installing it as a user service from git via bash install.sh does work.

In tty, it works fully as expected. But on Hyprland:

  • Switching from touchpad to numberpad doesn't disable touchpad, so it registers the number press, but also registers it as a mouse click, likely moving the cursor or removing focus from the text field;
  • Numberpad is automatically turned off if I press any regular keyboard button.

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@adamant-pwn Please post here driver logs for Hyprland

@adamant-pwn
Copy link

adamant-pwn commented Mar 7, 2024

Here's the error log of doing the following with bash install.sh installation:

  1. Switch the numberpad on.
  2. Try to use all buttons in order 0123456789/*-+.<enter> (it also registers by laptop as LMB clicks).
  3. Switch the numberpad off.
  4. Switch the numberpad on and press "a" (it switches off on its own).
/var/conf/asus-numberpad-driver/error.log
2024-03-07 20:47:50,858 INFO     Detecting keyboard from string: "N: Name="Asus Keyboard""
2024-03-07 20:47:50,888 INFO     Detecting keyboard from string: "N: Name="Asus Keyboard""
2024-03-07 20:47:50,888 INFO     Set keyboard 5 from H: Handlers=sysrq kbd leds event5
2024-03-07 20:47:50,904 INFO     Detecting touchpad from string: "N: Name="ASUE140F:00 04F3:32A2 Touchpad""
2024-03-07 20:47:50,905 INFO     Set touchpad device id 0 from S: Sysfs=/devices/platform/AMDI0010:00/i2c-0/i2c-ASUE140F:00/0018:04F3:32A2.0004/input/input26
2024-03-07 20:47:50,905 INFO     Set touchpad id 9 from H: Handlers=event9 mouse1
2024-03-07 20:47:50,905 INFO     Touchpad min-max: x 0-1710, y 0-2925
2024-03-07 20:47:50,905 INFO     Numpad min-max: x 20-1690, y 0-2925
2024-03-07 20:48:49,056 INFO     Touched numlock key (not top_right_icon) in time: 1709840929.0566313
2024-03-07 20:48:50,302 INFO     The numpad numlock was pressed longer than the activation time: 1.2456622123718262
2024-03-07 20:48:50,302 INFO     Activation time: 1.0
2024-03-07 20:48:50,302 INFO     Un-touched with NumberPad activation numlock key (not top_right_icon) in time: 1709840930.3024247
2024-03-07 20:48:50,341 INFO     System numlock activated
2024-03-07 20:48:50,341 INFO     Numpad activated
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
unable to find device ASUE140F:00 04F3:32A2 Touchpad
2024-03-07 20:48:50,394 INFO     Setting up for config file key: "enabled" with value: "True"
2024-03-07 20:48:50,394 INFO     check_config_values_changes: detected internal change of config file -> do nothing -> would be deadlock
<Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=numberpad_dev path=/usr/share/asus-numberpad-driver pathname=/usr/share/asus-numberpad-driver/numberpad_dev wd=1 >
2024-03-07 20:48:58,056 INFO     Pressed numpad key
2024-03-07 20:48:58,056 INFO     KEY_KP0:82
2024-03-07 20:48:58,056 INFO     Unpressed numpad key
2024-03-07 20:48:58,056 INFO     KEY_KP0:82
2024-03-07 20:49:01,097 INFO     Pressed numpad key
2024-03-07 20:49:01,097 INFO     KEY_KP1:79
2024-03-07 20:49:01,097 INFO     Unpressed numpad key
2024-03-07 20:49:01,097 INFO     KEY_KP1:79
2024-03-07 20:49:01,953 INFO     Pressed numpad key
2024-03-07 20:49:01,953 INFO     KEY_KP2:80
2024-03-07 20:49:01,953 INFO     Unpressed numpad key
2024-03-07 20:49:01,953 INFO     KEY_KP2:80
2024-03-07 20:49:04,173 INFO     Pressed numpad key
2024-03-07 20:49:04,173 INFO     KEY_KP3:81
2024-03-07 20:49:04,173 INFO     Unpressed numpad key
2024-03-07 20:49:04,173 INFO     KEY_KP3:81
2024-03-07 20:49:04,803 INFO     Pressed numpad key
2024-03-07 20:49:04,803 INFO     KEY_KP4:75
2024-03-07 20:49:04,803 INFO     Unpressed numpad key
2024-03-07 20:49:04,803 INFO     KEY_KP4:75
2024-03-07 20:49:05,399 INFO     Pressed numpad key
2024-03-07 20:49:05,399 INFO     KEY_KP5:76
2024-03-07 20:49:05,399 INFO     Unpressed numpad key
2024-03-07 20:49:05,399 INFO     KEY_KP5:76
2024-03-07 20:49:06,680 INFO     Pressed numpad key
2024-03-07 20:49:06,680 INFO     KEY_KP6:77
2024-03-07 20:49:06,680 INFO     Unpressed numpad key
2024-03-07 20:49:06,680 INFO     KEY_KP6:77
2024-03-07 20:49:07,940 INFO     Pressed numpad key
2024-03-07 20:49:07,940 INFO     KEY_KP7:71
2024-03-07 20:49:07,940 INFO     Unpressed numpad key
2024-03-07 20:49:07,940 INFO     KEY_KP7:71
2024-03-07 20:49:08,810 INFO     Pressed numpad key
2024-03-07 20:49:08,810 INFO     KEY_KP8:72
2024-03-07 20:49:08,810 INFO     Unpressed numpad key
2024-03-07 20:49:08,810 INFO     KEY_KP8:72
2024-03-07 20:49:10,104 INFO     Pressed numpad key
2024-03-07 20:49:10,104 INFO     KEY_KP9:73
2024-03-07 20:49:10,104 INFO     Unpressed numpad key
2024-03-07 20:49:10,104 INFO     KEY_KP9:73
2024-03-07 20:49:13,172 INFO     Pressed numpad key
2024-03-07 20:49:13,172 INFO     KEY_KPSLASH:98
2024-03-07 20:49:13,172 INFO     Unpressed numpad key
2024-03-07 20:49:13,172 INFO     KEY_KPSLASH:98
2024-03-07 20:49:14,692 INFO     Pressed numpad key
2024-03-07 20:49:14,692 INFO     KEY_KPASTERISK:55
2024-03-07 20:49:14,692 INFO     Unpressed numpad key
2024-03-07 20:49:14,692 INFO     KEY_KPASTERISK:55
2024-03-07 20:49:15,870 INFO     Pressed numpad key
2024-03-07 20:49:15,870 INFO     KEY_KPMINUS:74
2024-03-07 20:49:15,870 INFO     Unpressed numpad key
2024-03-07 20:49:15,870 INFO     KEY_KPMINUS:74
2024-03-07 20:49:17,027 INFO     Pressed numpad key
2024-03-07 20:49:17,027 INFO     KEY_KPPLUS:78
2024-03-07 20:49:17,027 INFO     Unpressed numpad key
2024-03-07 20:49:17,027 INFO     KEY_KPPLUS:78
2024-03-07 20:49:19,520 INFO     Pressed numpad key
2024-03-07 20:49:19,520 INFO     KEY_KPDOT:83
2024-03-07 20:49:19,520 INFO     Unpressed numpad key
2024-03-07 20:49:19,520 INFO     KEY_KPDOT:83
2024-03-07 20:49:22,273 INFO     Pressed numpad key
2024-03-07 20:49:22,273 INFO     KEY_KPENTER:96
2024-03-07 20:49:22,273 INFO     Unpressed numpad key
2024-03-07 20:49:22,273 INFO     KEY_KPENTER:96
2024-03-07 20:49:26,314 INFO     Touched numlock key (not top_right_icon) in time: 1709840966.3148735
2024-03-07 20:49:27,984 INFO     The numpad numlock was pressed longer than the activation time: 1.6697912216186523
2024-03-07 20:49:27,984 INFO     Activation time: 1.0
2024-03-07 20:49:27,984 INFO     Un-touched with NumberPad activation numlock key (not top_right_icon) in time: 1709840967.9847977
2024-03-07 20:49:28,024 INFO     System numlock deactivated
2024-03-07 20:49:28,024 INFO     Numpad deactivated
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
unable to find device ASUE140F:00 04F3:32A2 Touchpad
2024-03-07 20:49:28,040 INFO     Setting up for config file key: "enabled" with value: "False"
2024-03-07 20:49:28,040 INFO     check_config_values_changes: detected internal change of config file -> do nothing -> would be deadlock
<Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=numberpad_dev path=/usr/share/asus-numberpad-driver pathname=/usr/share/asus-numberpad-driver/numberpad_dev wd=1 >
2024-03-07 20:50:32,974 INFO     Touched numlock key (not top_right_icon) in time: 1709841032.9748936
2024-03-07 20:50:34,384 INFO     The numpad numlock was pressed longer than the activation time: 1.4100697040557861
2024-03-07 20:50:34,385 INFO     Activation time: 1.0
2024-03-07 20:50:34,385 INFO     Un-touched with NumberPad activation numlock key (not top_right_icon) in time: 1709841034.3850563
2024-03-07 20:50:34,411 INFO     System numlock activated
2024-03-07 20:50:34,411 INFO     Numpad activated
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
unable to find device ASUE140F:00 04F3:32A2 Touchpad
2024-03-07 20:50:34,428 INFO     Setting up for config file key: "enabled" with value: "True"
2024-03-07 20:50:34,428 INFO     check_config_values_changes: detected internal change of config file -> do nothing -> would be deadlock
<Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=numberpad_dev path=/usr/share/asus-numberpad-driver pathname=/usr/share/asus-numberpad-driver/numberpad_dev wd=1 >
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
unable to find device ASUE140F:00 04F3:32A2 Touchpad
2024-03-07 20:50:35,607 INFO     Setting up for config file key: "enabled" with value: "False"
2024-03-07 20:50:35,607 INFO     check_config_values_changes: detected internal change of config file -> do nothing -> would be deadlock
<Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=numberpad_dev path=/usr/share/asus-numberpad-driver pathname=/usr/share/asus-numberpad-driver/numberpad_dev wd=1 >
2024-03-07 20:50:35,707 INFO     Numpad deactivated

@adamant-pwn
Copy link

And as for asus-numberpad-driver-gx551-git installation, it gives the following:

[adamant@zephyrus-duo-16 ~]$ systemctl status asus_numberpad_driver
× asus_numberpad_driver.service - Asus NumberPad Driver
     Loaded: loaded (/usr/lib/systemd/system/asus_numberpad_driver.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2024-03-07 20:57:59 CET; 49s ago
   Duration: 566us
    Process: 812 ExecStart=/usr/share/asus-numberpad-driver/.env/bin/python3 /usr/share/asus-numberpad-driver/numberpad.py gx551 /usr/share/asus-numberpad-driver (code=exited, status=203/EXEC)
   Main PID: 812 (code=exited, status=203/EXEC)
        CPU: 433us

Mar 07 20:57:59 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Scheduled restart job, restart counter is at 5.
Mar 07 20:57:59 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Start request repeated too quickly.
Mar 07 20:57:59 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Failed with result 'exit-code'.
Mar 07 20:57:59 zephyrus-duo-16 systemd[1]: Failed to start Asus NumberPad Driver.

@adamant-pwn
Copy link

adamant-pwn commented Mar 7, 2024

On some further inspection, the command from the global service

/usr/share/asus-numberpad-driver/.env/bin/python3 /usr/share/asus-numberpad-driver/numberpad.py gx551 /usr/share/asus-numberpad-driver

fails because .env doesn't exist in /usr/share/asus-numberpad-driver on my machine for some reason.

So, also reported it on AUR.

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@adamant-pwn What is output of $ libinput debug-events because touchpad device was not found unable to find device ASUE140F:00 04F3:32A2 Touchpad

EDIT: hm, it will be output of $ xinput, not relevant on wayland

@kamack38
Copy link
Member

kamack38 commented Mar 7, 2024

@kamack38 Could you check it please?

I'll fix the package on Saturday. As to the Wayland driver I'm using Hyprland too but I'll still check it out then.

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@adamant-pwn Wait, you can enable/disable tap-to-click using xinput? So only one problem is the device names are different because of wayland compositor?

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@adamant-pwn Please, what is output of these commands:

  • $ xinput list-props <device_of_touchpad - probably xwayland-touch?>
  • $ xinput list-props <Virtual core XTEST keyboard>
  • $ xinput list-props <xwayland-keyboard>

@adamant-pwn
Copy link

Oh, Hyprland actually has a setting that disables touchpad while typing, and it is true by default, so it might have contributed to why numberpad gets disabled if I type something on the keyboard? But turning it to false doesn't help, as the log still says

2024-03-07 21:31:48,687 INFO     Pressed numpad key
2024-03-07 21:31:48,687 INFO     KEY_KP9:73
2024-03-07 21:31:48,687 INFO     Unpressed numpad key
2024-03-07 21:31:48,687 INFO     KEY_KP9:73
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
unable to find device ASUE140F:00 04F3:32A2 Touchpad
2024-03-07 21:31:51,805 INFO     Setting up for config file key: "enabled" with value: "False"
2024-03-07 21:31:51,805 INFO     check_config_values_changes: detected internal change of config file -> do nothing -> would be deadlock
<Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=numberpad_dev path=/usr/share/asus-numberpad-driver pathname=/usr/share/asus-numberpad-driver/numberpad_dev wd=1 >
2024-03-07 21:31:51,905 INFO     Numpad deactivated

whenever I press a keyboard button while numberpad is active. Also here is the output of commands:

[adamant@zephyrus-duo-16 ~/asus-numberpad-driver]$ xinput list-props "Virtual core XTEST keyboard"
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
Device 'Virtual core XTEST keyboard':
	Device Enabled (120):	1
	Coordinate Transformation Matrix (122):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	XTEST Device (231):	1

[adamant@zephyrus-duo-16 ~/asus-numberpad-driver]$ xinput list-props xwayland-touch:14
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
Device 'xwayland-touch:14':
	Device Enabled (120):	1
	Coordinate Transformation Matrix (122):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (237):	0
	Device Accel Constant Deceleration (238):	1.000000
	Device Accel Adaptive Deceleration (239):	1.000000
	Device Accel Velocity Scaling (240):	10.000000

[adamant@zephyrus-duo-16 ~/asus-numberpad-driver]$ xinput list-props xwayland-keyboard:14
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
Device 'xwayland-keyboard:14':
	Device Enabled (120):	1
	Coordinate Transformation Matrix (122):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@adamant-pwn Do you have $ gsettings? Try this:

$ gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-to-click' false
# test whether you can tap-to-click touchpad, no? It works
$ gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-to-click' true

@adamant-pwn
Copy link

I have gsettings, but I can still tap-to-click after using that command.

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@adamant-pwn Is your distro gnome based?

@adamant-pwn
Copy link

I use Hyprland window manager on Arch Linux, I don't have any desktop environment.

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@kamack38 Do not you use the same setup? Arch with Hyprland? How do you disable touchpad's tap-to-click? By mentioned gsettings?

@kamack38
Copy link
Member

kamack38 commented Mar 7, 2024

@kamack38 Do not you use the same setup? Arch with Hyprland? How do you disable touchpad's tap-to-click? By mentioned gsettings?

What do you mean by tap-to-click?

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 7, 2024

@kamack38 By default is driver installed with enabled_touchpad_pointer=3. Do you use 3? And then when is NumberPad activated is disabled touchpad's left-click by touch (tap-to-click device libinput option - in my case - x11)

@kamack38
Copy link
Member

kamack38 commented Mar 7, 2024

@kamack38 By default is driver installed with enabled_touchpad_pointer=3. Do you use 3? And then when is NumberPad activated is disabled touchpad's left-click by touch (tap-to-click device libinput option - in my case - x11)

I haven't used the driver for a while since I'm currently primarily on Wayland and I'm using an external keyboard but when I get back I'll check how everything works.

@kamack38
Copy link
Member

kamack38 commented Mar 9, 2024

❯ G_MESSAGES_DEBUG=all LOG=DEBUG python3 /usr/share/asus-numberpad-driver/numberpad.py g533 /usr/share/asus-numberpad-driver
2024-03-09 18:57:40,170 INFO     Detecting keyboard from string: "N: Name="Asus Keyboard""
2024-03-09 18:57:40,216 INFO     Detecting touchpad from string: "N: Name="ASUE1403:00 04F3:319A Touchpad""
2024-03-09 18:57:40,216 INFO     Set touchpad device id 0 from S: Sysfs=/devices/platform/AMDI0010:00/i2c-0/i2c-ASUE1403:00/0018:04F3:319A.000C/input/input34
2024-03-09 18:57:40,216 INFO     Set touchpad id 17 from H: Handlers=event17 mouse1
2024-03-09 18:57:40,216 INFO     Detecting keyboard from string: "N: Name="ASUE1403:00 04F3:319A Keyboard""
2024-03-09 18:57:40,216 INFO     Set keyboard 19 from H: Handlers=sysrq kbd leds event19
2024-03-09 18:57:40,246 ERROR    Can't open the I2C bus connection (id: 0)

After fixing the package dependencies, it doesn't work for me on Wayland

EDIT: I have an issue with DBUS running the command with sudo works

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 9, 2024

@kamack38 It does not look like problem with dbus but with permissions problem during accessing I2c device as user (without sudo) - permissions should be added automatically when laptop boot for user (inside file) or I2C device with id 0 does not exist but that would be strange

@ldrahnik
Copy link
Member Author

ldrahnik commented Mar 15, 2024

@adamant-pwn Does work for you arch package with changes by @kamack38?

@kamack38
Copy link
Member

After reading this Arch Wiki article, it occurred to me that if we figure out how to send keysyms we would be able to avoid any Xorg and Wayland dependency.

@ldrahnik ldrahnik linked a pull request Apr 2, 2024 that will close this issue
@ldrahnik
Copy link
Member Author

ldrahnik commented Apr 2, 2024

@kamack38 I do not know what do you mean.

At the protocol level, wayland has a wl_keyboard.keymap event. This event contains a file descriptor to the keymap and a format classifier. Right now, only one format is defined: "xkb". So a wayland client will receive an XKB-compatible keymap and can use libxkbcommon to interpret that to get the right glyph on the screen, etc. (https://unix.stackexchange.com/questions/309580/does-wayland-use-xkb-for-keyboard-layouts/309729#309729)

I tried to implement a way for Wayland. The branch is attached, look at that, please. It looks like it works under Ubuntu 22.04 partially, when I move in the settings keyboard layout French BEPO to the first position, then I receive via hook new keymap, also to the client compositor sends the current layout BEPO as active correctly and others as inactive, and for example for 'u' character usually printed under 'u' with keycode 22 keymap correctly says 31 s as it is correct for French BEPO BUT when I change keyboard layout via Super+Space I do not receive any event with new keymap for changed active keyboard via hook so it still sends wrong character.

IMHO it is better than nothing and can be merged but as I do not use wayland yet I developed that in virtual box with Ubuntu22.04, needs to be tested first.

@adamant-pwn
Copy link

adamant-pwn commented Apr 18, 2024

Hi, sorry for the delayed response! AUR package asus-numberpad-driver-gx551-git still doesn't work for me:

[adamant@zephyrus-duo-16 ~]$ systemctl status asus_numberpad_driver
× asus_numberpad_driver.service - Asus NumberPad Driver
     Loaded: loaded (/usr/lib/systemd/system/asus_numberpad_driver.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2024-04-18 14:24:28 CEST; 1min 45s ago
   Duration: 2ms
    Process: 797 ExecStart=python3 /usr/share/asus-numberpad-driver/numberpad.py gx551 /usr/share/asus-numberpad-driver (code=exited, status=209/STDOUT)
   Main PID: 797 (code=exited, status=209/STDOUT)
        CPU: 3ms

Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Scheduled restart job, restart counter is at 5.
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Start request repeated too quickly.
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Failed with result 'exit-code'.
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: Failed to start Asus NumberPad Driver.

Also when I try to execute the command separately, I get:

[adamant@zephyrus-duo-16 ~]$ python3 /usr/share/asus-numberpad-driver/numberpad.py gx551 /usr/share/asus-numberpad-driver
2024-04-18 14:29:24,003 ERROR    Numpad layout *.py from dir layouts is required as first argument. Re-run install script or add missing first argument (valid value is b7402, e210ma, g533, gx551, gx701, up5401ea, ..).

@ldrahnik
Copy link
Member Author

@adamant-pwn

Also when I try to execute the command separately, I get:

[adamant@zephyrus-duo-16 ~]$ python3 /usr/share/asus-numberpad-driver/numberpad.py gx551 /usr/share/asus- numberpad-driver
2024-04-18 14:29:24,003 ERROR Numpad layout *.py from dir layouts is required as first argument. Re-run inst

Directly it should work now as I committed the missing standard layout gx551. Were exist only gx551-unicode and gx551-non-unicode variant.

@ldrahnik
Copy link
Member Author

ldrahnik commented Apr 18, 2024

@adamant-pwn

Hi, sorry for the delayed response! AUR package asus-numberpad-driver-gx551-git still doesn't work for me:

[adamant@zephyrus-duo-16 ~]$ systemctl status asus_numberpad_driver
× asus_numberpad_driver.service - Asus NumberPad Driver
    Loaded: loaded (/usr/lib/systemd/system/asus_numberpad_driver.service; enabled; preset: disabled)
    Active: failed (Result: exit-code) since Thu 2024-04-18 14:24:28 CEST; 1min 45s ago
  Duration: 2ms
   Process: 797 ExecStart=python3 /usr/share/asus-numberpad-driver/numberpad.py gx551 /usr/share/asus-numberpad->driver (code=exited, status=209/STDOUT)
  Main PID: 797 (code=exited, status=209/STDOUT)
       CPU: 3ms
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Scheduled restart job, restart counter is at 5.
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Start request repeated too quickly.
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: asus_numberpad_driver.service: Failed with result 'exit-code'.
Apr 18 14:24:28 zephyrus-duo-16 systemd[1]: Failed to start Asus NumberPad Driver.```

Without an error log we unfortunately can do nothing as we only see the return code. Thank you for posting. Np for delay.

@ldrahnik
Copy link
Member Author

ldrahnik commented May 2, 2024

Can be reopened.

@ldrahnik ldrahnik closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request refactoring
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants