asus-linux-drivers / asus-numberpad-driver

Maintained feature-rich linux driver for NumberPad(2.0) on Asus laptops. NumberPad(2.0) is illuminated numeric keypad integrated to touchpad which appears when is done tap on top right corner of touchpad for atleast 1s by default (configurable) or slide gesture from top right/left corner to the center, the left shows calc app aswell (configurable).
GNU General Public License v2.0
254 stars 16 forks source link

[Bug]: Top buttons don't work and numbers don't match #187

Closed Triw-12 closed 12 hours ago

Triw-12 commented 1 month ago

Describe the bug

1st problem: the buttons for changing numpad brightness and for activating/deactivating the numpad simply don't work, even with a long press.

2nd problem: Numbers return other characters that would correspond if I had pressed the keyboard keys without shift. For example, when I press 7, the character "è" appears (I have an azerty keyboard). Strangely, this problem does not appear in the search bars. Strangely enough, this problem does not appear in the search bars, but in applications such as word processing or the calculator, the problem does appear.

Expected behavior

I'd like the keyboard to switch on/off when I press the top keys, and to be able to adjust the contrast. I'd like the keys to display numbers correctly.

Relevant log output

Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "ASUP1415:00 093A:300C NumberPad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3)
    Event code 5 (KEY_4)
    Event code 6 (KEY_5)
    Event code 7 (KEY_6)
    Event code 8 (KEY_7)
    Event code 9 (KEY_8)
    Event code 10 (KEY_9)
    Event code 11 (KEY_0)
    Event code 13 (KEY_EQUAL)
    Event code 14 (KEY_BACKSPACE)
    Event code 16 (KEY_Q)
    Event code 18 (KEY_E)
    Event code 22 (KEY_U)
    Event code 28 (KEY_ENTER)
    Event code 29 (KEY_LEFTCTRL)
    Event code 32 (KEY_D)
    Event code 33 (KEY_F)
    Event code 40 (KEY_APOSTROPHE)
    Event code 42 (KEY_LEFTSHIFT)
    Event code 43 (KEY_BACKSLASH)
    Event code 46 (KEY_C)
    Event code 48 (KEY_B)
    Event code 51 (KEY_COMMA)
    Event code 52 (KEY_DOT)
    Event code 57 (KEY_SPACE)
    Event code 69 (KEY_NUMLOCK)
    Event code 140 (KEY_CALC)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
Properties:
Testing ... (interrupt to exit)
Event: time 1721924934.463091, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924934.463091, -------------- SYN_REPORT ------------
Event: time 1721924934.463153, type 1 (EV_KEY), code 11 (KEY_0), value 1
Event: time 1721924934.463153, -------------- SYN_REPORT ------------
Event: time 1721924934.463272, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924934.463272, -------------- SYN_REPORT ------------
Event: time 1721924934.463300, type 1 (EV_KEY), code 11 (KEY_0), value 0
Event: time 1721924934.463300, -------------- SYN_REPORT ------------
àEvent: time 1721924935.321111, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924935.321111, -------------- SYN_REPORT ------------
Event: time 1721924935.321144, type 1 (EV_KEY), code 2 (KEY_1), value 1
Event: time 1721924935.321144, -------------- SYN_REPORT ------------
Event: time 1721924935.321203, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924935.321203, -------------- SYN_REPORT ------------
Event: time 1721924935.321217, type 1 (EV_KEY), code 2 (KEY_1), value 0
Event: time 1721924935.321217, -------------- SYN_REPORT ------------
&Event: time 1721924936.100379, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924936.100379, -------------- SYN_REPORT ------------
Event: time 1721924936.100438, type 1 (EV_KEY), code 5 (KEY_4), value 1
Event: time 1721924936.100438, -------------- SYN_REPORT ------------
Event: time 1721924936.100577, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924936.100577, -------------- SYN_REPORT ------------
Event: time 1721924936.100612, type 1 (EV_KEY), code 5 (KEY_4), value 0
Event: time 1721924936.100612, -------------- SYN_REPORT ------------
'Event: time 1721924936.600268, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924936.600268, -------------- SYN_REPORT ------------
Event: time 1721924936.600323, type 1 (EV_KEY), code 8 (KEY_7), value 1
Event: time 1721924936.600323, -------------- SYN_REPORT ------------
Event: time 1721924936.600464, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924936.600464, -------------- SYN_REPORT ------------
Event: time 1721924936.600497, type 1 (EV_KEY), code 8 (KEY_7), value 0
Event: time 1721924936.600497, -------------- SYN_REPORT ------------
èEvent: time 1721924938.930150, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924938.930150, -------------- SYN_REPORT ------------
Event: time 1721924938.930211, type 1 (EV_KEY), code 3 (KEY_2), value 1
Event: time 1721924938.930211, -------------- SYN_REPORT ------------
Event: time 1721924938.930345, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924938.930345, -------------- SYN_REPORT ------------
Event: time 1721924938.930378, type 1 (EV_KEY), code 3 (KEY_2), value 0
Event: time 1721924938.930378, -------------- SYN_REPORT ------------
éEvent: time 1721924939.440733, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924939.440733, -------------- SYN_REPORT ------------
Event: time 1721924939.440795, type 1 (EV_KEY), code 6 (KEY_5), value 1
Event: time 1721924939.440795, -------------- SYN_REPORT ------------
Event: time 1721924939.441101, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924939.441101, -------------- SYN_REPORT ------------
Event: time 1721924939.441139, type 1 (EV_KEY), code 6 (KEY_5), value 0
Event: time 1721924939.441139, -------------- SYN_REPORT ------------
(Event: time 1721924940.187389, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924940.187389, -------------- SYN_REPORT ------------
Event: time 1721924940.187443, type 1 (EV_KEY), code 9 (KEY_8), value 1
Event: time 1721924940.187443, -------------- SYN_REPORT ------------
Event: time 1721924940.187529, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924940.187529, -------------- SYN_REPORT ------------
Event: time 1721924940.187543, type 1 (EV_KEY), code 9 (KEY_8), value 0
Event: time 1721924940.187543, -------------- SYN_REPORT ------------
_Event: time 1721924941.445314, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924941.445314, -------------- SYN_REPORT ------------
Event: time 1721924941.445372, type 1 (EV_KEY), code 4 (KEY_3), value 1
Event: time 1721924941.445372, -------------- SYN_REPORT ------------
Event: time 1721924941.445506, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924941.445506, -------------- SYN_REPORT ------------
Event: time 1721924941.445541, type 1 (EV_KEY), code 4 (KEY_3), value 0
Event: time 1721924941.445541, -------------- SYN_REPORT ------------
"Event: time 1721924941.872920, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924941.872920, -------------- SYN_REPORT ------------
Event: time 1721924941.872986, type 1 (EV_KEY), code 7 (KEY_6), value 1
Event: time 1721924941.872986, -------------- SYN_REPORT ------------
Event: time 1721924941.873124, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924941.873124, -------------- SYN_REPORT ------------
Event: time 1721924941.873160, type 1 (EV_KEY), code 7 (KEY_6), value 0
Event: time 1721924941.873160, -------------- SYN_REPORT ------------
-Event: time 1721924942.336785, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924942.336785, -------------- SYN_REPORT ------------
Event: time 1721924942.336850, type 1 (EV_KEY), code 10 (KEY_9), value 1
Event: time 1721924942.336850, -------------- SYN_REPORT ------------
Event: time 1721924942.337003, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924942.337003, -------------- SYN_REPORT ------------
Event: time 1721924942.337043, type 1 (EV_KEY), code 10 (KEY_9), value 0
Event: time 1721924942.337043, -------------- SYN_REPORT ------------
çEvent: time 1721924943.838327, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924943.838327, -------------- SYN_REPORT ------------
Event: time 1721924943.838387, type 1 (EV_KEY), code 51 (KEY_COMMA), value 1
Event: time 1721924943.838387, -------------- SYN_REPORT ------------
Event: time 1721924943.838517, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924943.838517, -------------- SYN_REPORT ------------
Event: time 1721924943.838548, type 1 (EV_KEY), code 51 (KEY_COMMA), value 0
Event: time 1721924943.838548, -------------- SYN_REPORT ------------
;Event: time 1721924944.917174, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1
Event: time 1721924944.917174, -------------- SYN_REPORT ------------
Event: time 1721924944.917325, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1721924944.917325, -------------- SYN_REPORT ------------

Event: time 1721924946.746116, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924946.746116, -------------- SYN_REPORT ------------
Event: time 1721924946.746184, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 1
Event: time 1721924946.746184, -------------- SYN_REPORT ------------
Event: time 1721924946.746266, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924946.746266, -------------- SYN_REPORT ------------
Event: time 1721924946.746291, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 0
Event: time 1721924946.746291, -------------- SYN_REPORT ------------
=Event: time 1721924947.746778, type 1 (EV_KEY), code 7 (KEY_6), value 1
Event: time 1721924947.746778, -------------- SYN_REPORT ------------
Event: time 1721924947.746940, type 1 (EV_KEY), code 7 (KEY_6), value 0
Event: time 1721924947.746940, -------------- SYN_REPORT ------------
-Event: time 1721924948.954617, type 1 (EV_KEY), code 43 (KEY_BACKSLASH), value 1
Event: time 1721924948.954617, -------------- SYN_REPORT ------------
Event: time 1721924948.954768, type 1 (EV_KEY), code 43 (KEY_BACKSLASH), value 0
Event: time 1721924948.954768, -------------- SYN_REPORT ------------
*Event: time 1721924949.554956, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924949.554956, -------------- SYN_REPORT ------------
Event: time 1721924949.555018, type 1 (EV_KEY), code 52 (KEY_DOT), value 1
Event: time 1721924949.555018, -------------- SYN_REPORT ------------
Event: time 1721924949.555156, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924949.555156, -------------- SYN_REPORT ------------
Event: time 1721924949.555192, type 1 (EV_KEY), code 52 (KEY_DOT), value 0
Event: time 1721924949.555192, -------------- SYN_REPORT ------------
:Event: time 1721924951.169228, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 1
Event: time 1721924951.169228, -------------- SYN_REPORT ------------
Event: time 1721924951.169380, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 0
Event: time 1721924951.169380, -------------- SYN_REPORT ------------
=Event: time 1721924954.851159, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1
Event: time 1721924954.851159, -------------- SYN_REPORT ------------
Event: time 1721924954.851218, type 1 (EV_KEY), code 40 (KEY_APOSTROPHE), value 1
Event: time 1721924954.851218, -------------- SYN_REPORT ------------
Event: time 1721924954.851351, type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 0
Event: time 1721924954.851351, -------------- SYN_REPORT ------------
Event: time 1721924954.851390, type 1 (EV_KEY), code 40 (KEY_APOSTROPHE), value 0
Event: time 1721924954.851390, -------------- SYN_REPORT ------------
ùEvent: time 1721924955.794276, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 1
Event: time 1721924955.794276, -------------- SYN_REPORT ------------
Event: time 1721924955.794338, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 0
Event: time 1721924955.794338, -------------- SYN_REPORT ------------

[main]
numpad_disables_sys_numlock = 1
disable_due_inactivity_time = 0
touchpad_disables_numpad = 1
key_repetitions = 0
multitouch = 0
one_touch_key_rotation = 0
activation_time = 1
sys_numlock_enables_numpad = 1
top_left_icon_activation_time = 1
top_left_icon_slide_func_activation_radius = 1200
top_left_icon_slide_func_activates_numpad = 1
top_right_icon_slide_func_activation_radius = 1200
enabled_touchpad_pointer = 3
press_key_when_is_done_untouch = 1
enabled = 1
default_backlight_level = 0x01
brightness = 0x48
top_left_icon_brightness_func_disabled = 0
distance_to_move_only_pointer = 0
idled = 0
idle_brightness = 30
idle_enabled = 1
idle_time = 10

(all options are activated, model up5401ea, computer ASUS Zenbook 14 UM3406HA_UM3406HA)

Desktop

ldrahnik commented 1 month ago

@Triw-12 Hi, thank you for creating an issue. Could you please attach the install and error logs, both you can find under the directory /var/log/asus-numberpad-driver.

Triw-12 commented 1 month ago

Hello, Here are the files: error.log install-25-07-2024-18-23-00.log

ldrahnik commented 1 month ago

@Triw-12 Please add to this file asus_numberpad_driver.wayland.service line Environment="LOG=DEBUG" under [Service] and reinstall. In the error log you now should see the mapping of keys sent by your compositor though Wayland to this driver. Find something like (but with Wayland instead of X11):

2024-07-21 16:54:48,636 DEBUG X11 will try to load keymap
2024-07-21 16:54:48,637 DEBUG X11 loaded keymap succesfully
2024-07-21 16:54:48,637 DEBUG {'Num_Lock': KEY_NUMLOCK:69, '0': KEY_0:11, '1': KEY_1:2, '2': KEY_2:3, '3': KEY_3:4, '4': KEY_4:5, '5': KEY_5:6, '6': KEY_6:7, '7': KEY_7:8, '8': KEY_8:9, '9': KEY_9:10, 'a': KEY_A:30, 'b': KEY_B:48, 'c': KEY_C:46, 'd': KEY_D:32, 'e': KEY_E:18, 'f': KEY_F:33, 'Shift_L': KEY_LEFTSHIFT:42, 'Control_L': KEY_LEFTCTRL:29, 'u': KEY_U:22, 'space': KEY_SPACE:57, 'slash': KEY_SLASH:53, 'BackSpace': KEY_BACKSPACE:14, 'asterisk': [KEY_LEFTSHIFT:42, KEY_8:9], 'minus': KEY_MINUS:12, 'percent': [KEY_LEFTSHIFT:42, KEY_5:6], 'period': KEY_DOT:52, 'Return': KEY_ENTER:28, 'plus': [KEY_LEFTSHIFT:42, KEY_EQUAL:13], 'equal': KEY_EQUAL:13}

or post here entire log.

Triw-12 commented 1 month ago
2024-07-27 14:44:21,169 DEBUG Wayland will try to load keymap
2024-07-27 14:44:21,199 DEBUG Wayland loaded keymap succesfully
2024-07-27 14:44:21,199 DEBUG {'Num_Lock': KEY_NUMLOCK:69, '0': [KEY_LEFTSHIFT:42, KEY_0:11], '1': [KEY_LEFTSHIFT:42, KEY_1:2], '2': [KEY_LEFTSHIFT:42, KEY_2:3], '3': [KEY_LEFTSHIFT:42, KEY_3:4], '4': [KEY_LEFTSHIFT:42, KEY_4:5], '5': [KEY_LEFTSHIFT:42, KEY_5:6], '6': [KEY_LEFTSHIFT:42, KEY_6:7], '7': [KEY_LEFTSHIFT:42, KEY_7:8], '8': [KEY_LEFTSHIFT:42, KEY_8:9], '9': [KEY_LEFTSHIFT:42, KEY_9:10], 'a': KEY_Q:16, 'b': KEY_B:48, 'c': KEY_C:46, 'd': KEY_D:32, 'e': KEY_E:18, 'f': KEY_F:33, 'Shift_L': KEY_LEFTSHIFT:42, 'Control_L': KEY_LEFTCTRL:29, 'u': KEY_U:22, 'space': KEY_SPACE:57, 'slash': [KEY_LEFTSHIFT:42, KEY_DOT:52], 'BackSpace': KEY_BACKSPACE:14, 'asterisk': KEY_BACKSLASH:43, 'minus': KEY_6:7, 'percent': [KEY_LEFTSHIFT:42, KEY_APOSTROPHE:40], 'period': [KEY_LEFTSHIFT:42, KEY_COMMA:51], 'Return': KEY_ENTER:28, 'plus': [KEY_LEFTSHIFT:42, KEY_EQUAL:13], 'equal': KEY_EQUAL:13}
ldrahnik commented 1 month ago

@Triw-12 Corresponds that to the configuration inside your Wayland compositor? Keymap layout? In other words Is that correct? (I do not know which one - compositor - you use, e.g. hyprland)

EDIT: Do you have multiple keyboard layouts? Try install English with querty and switch between azerty and querty. Because you have enabled debugging you should now see in driver log layout Is changed and even key map should be changed every time.

ldrahnik commented 1 month ago

@Triw-12 About 1st problem, does work slide gesture to the center? To activating? Please, attach me here clean driver log with attempt.

EDIT: try on the latest master, please

Triw-12 commented 1 month ago

Thank you for your prompt replies and sorry mine were a bit slow.

@Triw-12 Corresponds that to the configuration inside your Wayland compositor? Keymap layout? In other words Is that correct? (I do not know which one - compositor - you use, e.g. hyprland)

EDIT: Do you have multiple keyboard layouts? Try install English with querty and switch between azerty and querty. Because you have enabled debugging you should now see in driver log layout Is changed and even key map should be changed every time.

I have the impression that the shift is not properly configured: it should be at 52 rather than 42 (I'm running GNOME) wayland.txt

Triw-12 commented 1 month ago

@Triw-12 About 1st problem, does work slide gesture to the center? To activating? Please, attach me here clean driver log with attempt.

EDIT: try on the latest master, please

By touching the numlock for more than a second :

2024-07-28 15:43:58,665 INFO Touched top_right_icon area (numlock) in time: 1722174238.6650488
2024-07-28 15:43:58,940 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174238.9404347
2024-07-28 15:43:59,141 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174239.1409836
2024-07-28 15:43:59,984 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174239.9849148
2024-07-28 15:44:00,305 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174240.3049948
2024-07-28 15:44:00,584 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174240.5846543
2024-07-28 15:44:00,905 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174240.9049573
2024-07-28 15:44:00,945 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174240.944957
2024-07-28 15:44:00,984 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174240.9844425
2024-07-28 15:44:01,064 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174241.0644221
2024-07-28 15:44:01,144 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174241.1442242
2024-07-28 15:44:01,224 INFO Un-touched top_right_icon area (representing numlock key) in time: 1722174241.2247372

Numpad remains off

By locking the numpad manually (change enable from numberpad_dev) and sliding the second button:

2024-07-28 15:50:13,986 INFO Touched top_left_icon area in time: 1722174613.9867203
2024-07-28 15:50:14,268 INFO Un-touched top_left_icon area in time: 1722174614.26861
2024-07-28 15:50:14,348 INFO Un-touched top_left_icon area in time: 1722174614.3488176
2024-07-28 15:50:14,552 INFO Un-touched top_left_icon area in time: 1722174614.5523615
2024-07-28 15:50:14,712 INFO Un-touched top_left_icon area in time: 1722174614.712445
2024-07-28 15:50:14,793 INFO Un-touched top_left_icon area in time: 1722174614.7930832
2024-07-28 15:50:14,833 INFO Un-touched top_left_icon area in time: 1722174614.8330245
2024-07-28 15:50:14,872 INFO Un-touched top_left_icon area in time: 1722174614.8724062
2024-07-28 15:50:15,033 INFO Un-touched top_left_icon area in time: 1722174615.0330153
2024-07-28 15:50:15,073 INFO Un-touched top_left_icon area in time: 1722174615.0729878
2024-07-28 15:50:15,113 INFO Un-touched top_left_icon area in time: 1722174615.1129735
2024-07-28 15:50:15,153 INFO Un-touched top_left_icon area in time: 1722174615.1529942

Full logs since reinstallation (I think there was an error during installation, which is why I'm putting it here): error.log

ldrahnik commented 1 month ago

Thank you for your prompt replies and sorry mine were a bit slow.

@Triw-12 Corresponds that to the configuration inside your Wayland compositor? Keymap layout? In other words Is that correct? (I do not know which one - compositor - you use, e.g. hyprland)

EDIT: Do you have multiple keyboard layouts? Try install English with querty and switch between azerty and querty. Because you have enabled debugging you should now see in driver log layout Is changed and even key map should be changed every time.

I have the impression that the shift is not properly configured: it should be at 52 rather than 42 (I'm running GNOME) wayland.txt

@Triw-12 Which Azerty keyboard layout do you use? Is modified? or is it the same as the original one? I would like to replicate your problem.

Screenshot from 2024-07-28 17 46 26

EDIT: why do you think correct is 52? You can look at my X11 output posted earlier, I have shift with event code 42 (50 keycode - 8) and I use standard US keyboard without modification and you have the same:

...
keycode  50 = Shift_L NoSymbol Shift_L NoSymbol Shift_L Shift_L
...
ldrahnik commented 1 month ago

@Triw-12 Strangely, this problem does not appear in the search bars. Strangely enough, this problem does not appear in the search bars, but in applications such as word processing or the calculator, the problem does appear.

@Triw-12 Can you please confirm that manually printing numbers using shift+numeric key above letters line QWERTY works? If I understood you correctly it works only in some places?

EDIT: I would still recommend to you install QWERTY keyboard and try to switch between them.

ldrahnik commented 1 month ago

@Triw-12 Have you installed distribution in clean way? Or you modified / installed wayland compositor by your own?

ldrahnik commented 1 month ago

@Triw-12 Install dconf and look here, especially try to disable per-window

Screenshot from 2024-07-28 18 34 45

Is your keyboard current?

Triw-12 commented 1 month ago

Here is my keyboard configuration :

# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="fr"
XKBVARIANT="latin9"
XKBOPTIONS=""

BACKSPACE="guess"

@Triw-12 Strangely, this problem does not appear in the search bars. Strangely enough, this problem does not appear in the search bars, but in applications such as word processing or the calculator, the problem does appear.

@Triw-12 Can you please confirm that manually printing numbers using shift+numeric key above letters line QWERTY works? If I understood you correctly it works only in some places?

EDIT: I would still recommend to you install QWERTY keyboard and try to switch between them.

I've tried it with an English keyboard and it works for numbers but not for operators (+, -, *, %, =). Unfortunately, I've tried with other keyboards but the numpad doesn't work anymore since I put the new configuration, but I get a new error in error.log :

Exception in thread Thread-6 (check_gnome_layout):
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/asus-numberpad-driver/numberpad.py", line 950, in check_gnome_layout
    layout_is_active = keyboard_state.layout_index_is_active(mru_layout_index, xkb.StateComponent.XKB_STATE_LAYOUT_EFFECTIVE)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/asus-numberpad-driver/.env/lib/python3.11/site-packages/xkbcommon/xkb.py", line 1221, in layout_index_is_active
    raise XKBInvalidLayoutIndex()
xkbcommon.xkb.XKBInvalidLayoutIndex

I've run a sudo evtest and the numpad is detected, but when I press the keys, nothing happens...

@Triw-12 Have you installed distribution in clean way? Or you modified / installed wayland compositor by your own?

I only installed the operating system a week ago (getting the numpad to work was pretty much the first thing I tested), so I'm unlikely to have changed any settings.

EDIT :

@Triw-12 Install dconf and look here, especially try to disable per-window

I don't understand what you want me to do...

ldrahnik commented 1 month ago

I don't understand what you want me to do...

@Triw-12 Install dconf. On Ubuntu with the command: sudo apt install dconf-editor. For arch try find out. It may be under the same package name. Then open dconf and go here /org/gnome/desktop/input-sources/ and post the screenshot of what do you see here.

Please, use the latest master. Not printing numbers at all should be solved by reverting the commit mentioned above.

ldrahnik commented 1 month ago

2nd problem: Numbers return other characters that would correspond if I had pressed the keyboard keys without shift. For example, when I press 7, the character "è" appears (I have an azerty keyboard). Strangely, this problem does not appear in the search bars. Strangely enough, this problem does not appear in the search bars, but in applications such as word processing or the calculator, the problem does appear.

@Triw-12 The second problem appears only after this NumberPad driver installation?

Triw-12 commented 1 month ago

@Triw-12 Install dconf. On Ubuntu with the command: sudo apt install dconf-editor. For arch try find out. It may be under the same package name. Then open dconf and go here /org/gnome/desktop/input-sources/ and post the screenshot of what do you see here.

Please, use the latest master. Not printing numbers at all should be solved by reverting the commit mentioned above.

image

The latest master has been solved the problem of not printing numbers !

2nd problem: Numbers return other characters that would correspond if I had pressed the keyboard keys without shift. For example, when I press 7, the character "è" appears (I have an azerty keyboard). Strangely, this problem does not appear in the search bars. Strangely enough, this problem does not appear in the search bars, but in applications such as word processing or the calculator, the problem does appear.

@Triw-12 The second problem appears only after this NumberPad driver installation?

Yes, I haven't found any other project that lets you use the numpad with this model.

ldrahnik commented 1 month ago

@Triw-12 I detected an error in the code when using this driver on distribution that uses mru-sources (later gnome) and wayland. Was not prioritized active layout from source mru-sources / was not reloaded keymap. Attempt to fix I have committed to the branch https://github.com/asus-linux-drivers/asus-numberpad-driver/tree/187-characters-do-not-match. Please, test it and let me know.

Triw-12 commented 1 month ago

Sorry, but I have the impression that nothing has changed...

Triw-12 commented 1 month ago

The strange thing is that the problem doesn't appear on certain search bars (such as gnome's application search) and when it doesn't work, it's the buttons that are engaged that are good, it's just the shift that doesn't work (after that I'm not sure how your code works)...

image

image

ldrahnik commented 1 month ago

@Triw-12 Hm. Please, do this in the mentioned branch:

$ systemctl stop --user asus_numberpad_driver@$USER.service # stop running service
$ cd asus-numberpad-driver
$ LOG=DEBUG /usr/share/asus-numberpad-driver/.env/bin/python3 /usr/share/asus-numberpad-driver/numberpad.py "up5401ea" # run with debug logs

And try to change the keyboard layouts during. How do you change them? Using the top panel? Open dconf application and keep watching whether is the most recently used (mru_sources here /org/gnome/desktop/input-sources/mru-sources) the same as is displayed on the top panel.

And check whether is the last visible keymap in the log correct for the currently selected keyboard layout. For me is this correct for US keyboard:

2024-08-17 17:59:47,302 DEBUG {'Num_Lock': KEY_NUMLOCK:69, '0': KEY_0:11, '1': KEY_1:2, '2': KEY_2:3, '3': KEY_3:4, '4': KEY_4:5, '5': KEY_5:6, '6': KEY_6:7, '7': KEY_7:8, '8': KEY_8:9, '9': KEY_9:10, 'a': KEY_A:30, 'b': KEY_B:48, 'c': KEY_C:46, 'd': KEY_D:32, 'e': KEY_E:18, 'f': KEY_F:33, 'Shift_L': KEY_LEFTSHIFT:42, 'Control_L': KEY_LEFTCTRL:29, 'u': KEY_U:22, 'space': KEY_SPACE:57, 'slash': KEY_SLASH:53, 'BackSpace': KEY_BACKSPACE:14, 'asterisk': [KEY_LEFTSHIFT:42, KEY_8:9], 'minus': KEY_MINUS:12, 'percent': [KEY_LEFTSHIFT:42, KEY_5:6], 'period': KEY_DOT:52, 'Return': KEY_ENTER:28, 'plus': [KEY_LEFTSHIFT:42, KEY_EQUAL:13], 'equal': KEY_EQUAL:13}

When I swap to French BEPO, this is correct for me:

2024-08-17 18:13:21,985 DEBUG {'Num_Lock': KEY_NUMLOCK:69, '0': [KEY_LEFTSHIFT:42, KEY_0:11], '1': [KEY_LEFTSHIFT:42, KEY_1:2], '2': [KEY_LEFTSHIFT:42, KEY_2:3], '3': [KEY_LEFTSHIFT:42, KEY_3:4], '4': [KEY_LEFTSHIFT:42, KEY_4:5], '5': [KEY_LEFTSHIFT:42, KEY_5:6], '6': [KEY_LEFTSHIFT:42, KEY_6:7], '7': [KEY_LEFTSHIFT:42, KEY_7:8], '8': [KEY_LEFTSHIFT:42, KEY_8:9], '9': [KEY_LEFTSHIFT:42, KEY_9:10], 'a': KEY_Q:16, 'b': KEY_B:48, 'c': KEY_C:46, 'd': KEY_D:32, 'e': KEY_E:18, 'f': KEY_F:33, 'Shift_L': KEY_LEFTSHIFT:42, 'Control_L': KEY_LEFTCTRL:29, 'u': KEY_U:22, 'space': KEY_SPACE:57, 'slash': [KEY_LEFTSHIFT:42, KEY_DOT:52], 'BackSpace': KEY_BACKSPACE:14, 'asterisk': KEY_BACKSLASH:43, 'minus': KEY_6:7, 'percent': [KEY_LEFTSHIFT:42, KEY_APOSTROPHE:40], 'period': [KEY_LEFTSHIFT:42, KEY_COMMA:51], 'Return': KEY_ENTER:28, 'plus': [KEY_LEFTSHIFT:42, KEY_EQUAL:13], 'equal': KEY_EQUAL:13}

What is the name of the application for zhich it does not work? I have found no problematic app in the virtual box wayland gnome ubuntu 22.04.

ldrahnik commented 1 month ago

@Triw-12 Do not have you shift as part of specific shortcut bound inside that app for which it does not work? So shift, and keys generaly for current keyboard layout (US, FR, CZ, ..) are sent from the driver succesfully (check using $ libinput debug-events, compare with what Is send from physical keyboard and let me know) but shift is consumed. Does it not work for multiple apps? I need to replicated that problem in my environment.

ldrahnik commented 4 weeks ago

@Triw-12 In short, I would focus what sequence of keys do send physical keyboard ($ libinput debug-events) for one specific problematics character for app when it works and when it does not and the same / what send this driver.

Triw-12 commented 4 weeks ago

After testing, the keyboard change is well recognized (thanks to the upper panel) and seems correct: For French AZERTY :

2024-08-18 15:01:47,828 DEBUG {'Num_Lock': KEY_NUMLOCK:69, '0': [KEY_LEFTSHIFT:42, KEY_0:11], '1': [KEY_LEFTSHIFT:42, KEY_1:2], '2': [KEY_LEFTSHIFT:42, KEY_2:3], '3': [KEY_LEFTSHIFT:42, KEY_3:4], '4': [KEY_LEFTSHIFT:42, KEY_4:5], '5': [KEY_LEFTSHIFT:42, KEY_5:6], '6': [KEY_LEFTSHIFT:42, KEY_6:7], '7': [KEY_LEFTSHIFT:42, KEY_7:8], '8': [KEY_LEFTSHIFT:42, KEY_8:9], '9': [KEY_LEFTSHIFT:42, KEY_9:10], 'a': KEY_Q:16, 'b': KEY_B:48, 'c': KEY_C:46, 'd': KEY_D:32, 'e': KEY_E:18, 'f': KEY_F:33, 'Shift_L': KEY_LEFTSHIFT:42, 'Control_L': KEY_LEFTCTRL:29, 'u': KEY_U:22, 'space': KEY_SPACE:57, 'slash': [KEY_LEFTSHIFT:42, KEY_DOT:52], 'BackSpace': KEY_BACKSPACE:14, 'asterisk': KEY_BACKSLASH:43, 'minus': KEY_6:7, 'percent': [KEY_LEFTSHIFT:42, KEY_APOSTROPHE:40], 'period': [KEY_LEFTSHIFT:42, KEY_COMMA:51], 'Return': KEY_ENTER:28, 'plus': [KEY_LEFTSHIFT:42, KEY_EQUAL:13], 'equal': KEY_EQUAL:13}

For French BEPO :

2024-08-18 15:13:01,908 DEBUG {'Num_Lock': KEY_NUMLOCK:69, '0': [KEY_LEFTSHIFT:42, KEY_0:11], '1': [KEY_LEFTSHIFT:42, KEY_1:2], '2': [KEY_LEFTSHIFT:42, KEY_2:3], '3': [KEY_LEFTSHIFT:42, KEY_3:4], '4': [KEY_LEFTSHIFT:42, KEY_4:5], '5': [KEY_LEFTSHIFT:42, KEY_5:6], '6': [KEY_LEFTSHIFT:42, KEY_6:7], '7': [KEY_LEFTSHIFT:42, KEY_7:8], '8': [KEY_LEFTSHIFT:42, KEY_8:9], '9': [KEY_LEFTSHIFT:42, KEY_9:10], 'a': KEY_A:30, 'b': KEY_Q:16, 'c': KEY_H:35, 'd': KEY_I:23, 'e': KEY_F:33, 'f': KEY_SLASH:53, 'Shift_L': KEY_LEFTSHIFT:42, 'Control_L': KEY_LEFTCTRL:29, 'u': KEY_S:31, 'space': KEY_SPACE:57, 'slash': KEY_9:10, 'BackSpace': KEY_BACKSPACE:14, 'asterisk': KEY_0:11, 'minus': KEY_8:9, 'percent': KEY_EQUAL:13, 'period': KEY_V:47, 'Return': KEY_ENTER:28, 'plus': KEY_7:8, 'equal': KEY_MINUS:12}

Shift-click also works correctly : For a click with the numpad (with libinput):

-event17  KEYBOARD_KEY            +62.683s  *** (-1) pressed
 event17  KEYBOARD_KEY            +62.684s  *** (-1) pressed
 event17  KEYBOARD_KEY            +62.684s  *** (-1) released
 event17  KEYBOARD_KEY            +62.684s  *** (-1) released

For a physical click :

-event0   KEYBOARD_KEY            +66.762s  *** (-1) pressed
 event0   KEYBOARD_KEY            +66.942s  *** (-1) pressed
 event0   KEYBOARD_KEY            +67.060s  *** (-1) released
 event0   KEYBOARD_KEY            +67.066s  *** (-1) released

The problem only appears in certain applications where the shift is not necessarily a shortcut:

But does not appear in:

ldrahnik commented 12 hours ago

Can be reopened.