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
242 stars 18 forks source link

[Bug]: not working for UX582LR (KDE) #95

Closed mbrouillet closed 1 year ago

mbrouillet commented 1 year ago

Describe the bug

I installed it in my home (for now) and there is no apparent error during install. I chose the closest match UX581LR but I have a UX582LR. I hit the top line of the keypad (there is a printed numpad) and

Expected behavior

I believe when touching the right corner of the touchpad a numeric keypad would light up and I would be able to type in numbers. Wherever I tap, long-press, double-tap, triple-tap on the top of the keypad, nothing alike happens.

Relevant log output

According to the Troubleshooting section of the README.md:

marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo systemctl stop asus_touchpad_numpad.service
marcel@ux582lr:~/asus-touchpad-numpad-driver$ LOG=DEBUG sudo -E ./asus_touchpad.py "ux581l" ""
INFO:asus-touchpad-numpad-driver:Detecting keyboard from string: "N: Name="AT Translated Set 2 keyboard""
INFO:asus-touchpad-numpad-driver:Set keyboard 3 from H: Handlers=sysrq kbd event3 leds
INFO:asus-touchpad-numpad-driver:Detecting touchpad from string: "N: Name="ELAN9009:00 04F3:2C23 Touchpad""
INFO:asus-touchpad-numpad-driver:Set touchpad device id 4 from S: Sysfs=/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-4/i2c-ELAN9009:00/0018:04F3:2C23.0003/input/input48
INFO:asus-touchpad-numpad-driver:Set touchpad id 27 from H: Handlers=mouse4 event27
INFO:asus-touchpad-numpad-driver:Touchpad min-max: x 0-3984, y 0-1152
INFO:asus-touchpad-numpad-driver:Numpad min-max: x 80-3904, y 200-1072
DEBUG:asus-touchpad-numpad-driver:Writting to config file: "<_io.TextIOWrapper name='asus_touchpad_numpad_dev' mode='w' encoding='UTF-8'>"

[nothing else, program keeps running, no additional line whatever I do on the touchpad]

Desktop

ldrahnik commented 1 year ago

@mbrouillet Try turn it off with $ sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad

mbrouillet commented 1 year ago

Try turn it off with $ sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad

Yes ! Works. Went off. The odd thing is that the backlight went on far later than the initial two commands you told me. I was able to type your reply, and play with the Fn keys, before it turned on.

mbrouillet commented 1 year ago

Now, for some reason, sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x01 0xad turns it on. sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad turns if off. Both instantly.

ldrahnik commented 1 year ago

@mbrouillet Touchpad was sleeping probably. I think how it implement to the code.

ldrahnik commented 1 year ago

@mbrouillet Workaround until I will commit better solution is to remove the entire driver, pull latest master, do only this change in asus_touchpad.py, line 213: if touchpad_detected == 0 and ("Name=\"ASUE" in line or "Name=\"ELAN" in line) and "Touchpad" in line: to if touchpad_detected == 0 and ("ELAN1406" in line) and "Touchpad" in line: and driver should works, let me know

mbrouillet commented 1 year ago

remove the entire driver,

You mean sudo uninstall ?

ldrahnik commented 1 year ago

@mbrouillet Yes, uninstall, git pull, do a workaround change in the code, install, use default config

mbrouillet commented 1 year ago

Keep this diff or not ?

diff --git a/asus_touchpad.py b/asus_touchpad.py
index 57aa886..d918752 100755
--- a/asus_touchpad.py
+++ b/asus_touchpad.py
@@ -136,10 +136,10 @@ def send_value_to_touchpad_via_i2c(value):

     cmd = ["i2ctransfer", "-f", "-y", device_id, "w13@0x15", "0x05", "0x00", "0x3d", "0x03", "0x06", "0x00", "0x07", "0x00", "0x0d", "0x14", "0x03", value, "0xad"]

-    try:
-        subprocess.call(cmd)
-    except subprocess.CalledProcessError as e:
-        log.error('Error during sending via i2c: \"%s\"', e.output)
+#    try:
+#        subprocess.call(cmd)
+#    except subprocess.CalledProcessError as e:
+#        log.error('Error during sending via i2c: \"%s\"', e.output)

 def parse_value_from_config(value):
@@ -1470,4 +1470,4 @@ try:
     listen_touchpad_events()
 except:
     logging.exception("Listening touchpad events unexpectedly failed")
-    sys.exit(1)
\ No newline at end of file
+    sys.exit(1)
ldrahnik commented 1 year ago

@mbrouillet Do not keep, only workaround change in the code

mbrouillet commented 1 year ago

@mbrouillet Do not keep, only workaround change in the code

Unfortunately, does not work… ;-(. Git pull at the end should have been before, but shows it's up to date after all.

arcel@ux582lr:~/asus-touchpad-numpad-driver$ vi asus_touchpad.py
marcel@ux582lr:~/asus-touchpad-numpad-driver$ git diff
diff --git a/asus_touchpad.py b/asus_touchpad.py
index 57aa886..431dead 100755
--- a/asus_touchpad.py
+++ b/asus_touchpad.py
@@ -210,7 +210,8 @@ while try_times > 0:
         lines = f.readlines()
         for line in lines:
             # Look for the touchpad #
-            if touchpad_detected == 0 and ("Name=\"ASUE" in line or "Name=\"ELAN" in line) and "Touchpad" in line:
+#           if touchpad_detected == 0 and ("Name=\"ASUE" in line or "Name=\"ELAN" in line) and "Touchpad" in line:
+            if touchpad_detected == 0 and ("ELAN1406" in line) and "Touchpad" in line:
                 touchpad_detected = 1
                 log.info('Detecting touchpad from string: \"%s\"', line.strip())
                 touchpad_name = line.split("\"")[1]
@@ -1470,4 +1471,4 @@ try:
     listen_touchpad_events()
 except:
     logging.exception("Listening touchpad events unexpectedly failed")
-    sys.exit(1)
\ No newline at end of file
+    sys.exit(1)
marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo systemctl stop asus_touchpad_numpad.service
marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo ./install.sh 
apt is here
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libevdev2 is already the newest version (1.12.1+dfsg-1).
i2c-tools is already the newest version (4.3-2build1).
python3-dev is already the newest version (3.10.6-1~22.04).
python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
xinput is already the newest version (1.6.3-1build2).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Requirement already satisfied: libevdev in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (0.5)
Requirement already satisfied: evdev in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 2)) (1.6.1)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (1.21.5)
Requirement already satisfied: inotify in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 4)) (0.2.10)
Requirement already satisfied: nose in /usr/local/lib/python3.10/dist-packages (from inotify->-r requirements.txt (line 4)) (1.3.7)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Testing interface i2c-1 : failed
Testing interface i2c-2 : sucess
Detected laptop: ZenBook Pro Duo UX582LR_UX582LR
Automatically recommended numpad layout: ux581l (associated to UX582LR_UX582LR). You can specify numpad layout later by yourself. When is recommended layout wrong please create an issue (https://github.com/asus-linux-drivers/asus-touchpad-numpad-driver/issues). Do you want use recommended numpad layout? [y/N]y
Selected key layout ux581l
Installing asus touchpad service to /etc/systemd/system/
X11 is detected
Installing udev rules to /usr/lib/udev/rules.d/
Added 90-numberpad-external-keyboard.rules
Created symlink /etc/systemd/system/graphical.target.wants/asus_touchpad_numpad.service → /etc/systemd/system/asus_touchpad_numpad.service.
Asus touchpad service enabled
Asus touchpad service started
Installed default config which can be futher modified here:
/usr/share/asus_touchpad_numpad-driver/asus_touchpad_numpad_dev
gsettings is here
Do you want automatically try install toggling script for XF86Calculator key? Slide from top left icon will then invoke/close detected calculator app. [y/N]y
No such schema “org.gnome.settings-daemon.plugins.media-keys”
Automatic installing of toggling script for XF86Calculator key failed. Please create an issue (https://github.com/asus-linux-drivers/asus-touchpad-numpad-driver/issues).
Install finished
marcel@ux582lr:~/asus-touchpad-numpad-driver$ git pull
Already up to date.
marcel@ux582lr:~/asus-touchpad-numpad-driver$ 
ldrahnik commented 1 year ago

@mbrouillet Log says?

mbrouillet commented 1 year ago

SORRY !! Works !!!! I'm not sure what I did wrong in my previous test, but keeping the finger 1sec on the top right corner switches the backlight on, and here are the numbers from keypad : 012345678/*-

mbrouillet commented 1 year ago

% key pastes an old buffer… I'm not sure why. But all the rest seems to function. (except that some of my Fn keys (volume, lock) no longer work, but that may be damage from the other driver) A HUGE THANK YOU !!! I owe you a beer.

ldrahnik commented 1 year ago

@mbrouillet Put a star on repo or buy me a coffee :D I will commit better solution and let you know in this thread so you will not have to do any workarounds after git pull but not sure it will be this night

ldrahnik commented 1 year ago

@mbrouillet What do you mean by % key pastes an old buffer…

mbrouillet commented 1 year ago

I owe you a few packs of beers, sorry. When I press the % key (that is between = and backspace on the top row of the touchpad, it pastes what had been previously copied. I was surprised by what was in there, but if I copy something fresh, it is that what was copied that get pasted. It does not enter the % symbol. It actually pastes more. For instance, I just copy the word « something » in the above sentence with Ctrl-C, and this is what comes out when I hit % on keypad : something«) So it adds two characters, oddly.

ldrahnik commented 1 year ago

@mbrouillet Uninstall wmi hotkey driver from me (in root of driver run cd asus-wmi-hotkeys-driver && sudo ./uninstall.sh and when will does not work any Fn keys create issue here and we will solve that

mbrouillet commented 1 year ago

@mbrouillet Uninstall wmi hotkey driver from me (in root of driver run sudo ./uninstall.sh and when will does not work any Fn keys create issue there and we will solve that

Thanks. The volume keys used to work fine. I'll see after a reboot. But since I have quite some accounting to do, having a numeric keypad is so much more useful than changing my volume :-). Thank you.

mbrouillet commented 1 year ago

And I'll try to understand what needs to be done to have a value for org.gnome.settings-daemon.plugins.media-keys custom-keybindings (if I understand you correctly). BTW, the two characters that are added to the pasted buffer, ») are what I get when I type the keys 3 and 5 of the main keyboard (that is set as FR Bepo layout). Does that ring any bell ?

mbrouillet commented 1 year ago

Also off-context, but I tried to summarize how I got sound to work on my system here on this post Is there a better place to keep track of that info, close and warm to your other Asus drivers ? Have a great night. Thank you so much.

ldrahnik commented 1 year ago

@mbrouillet Better solution pushed, should not be needed edit code as workaround, please let me know it works (git pull, uninstall, install)

ldrahnik commented 1 year ago

@mbrouillet I could merge that sound to work to asus random useful notes repository, feel free to make a pull request so you will be displayed as a contributor (in case you think it is useful for others / others have the same problem, i did not read that thread)

ldrahnik commented 1 year ago

@mbrouillet For using character % you have to be able use the shortcut Ctrl + Shift + U for sending unicode characters, more info here for example https://sysadmin-journal.com/insert-unicode-characters-in-kde-using-ctrl-u/, is required enable IBUS. Try to install sudo apt install -y ibus.

mbrouillet commented 1 year ago

@mbrouillet Better solution pushed, should not be needed edit code as workaround, please let me know it works (git pull, uninstall, install)

I rebooted my laptop this morning. With the patch of last night, it was working fine. I erased asus_touchpad.py, pulled git, confirmed by git status that I have a clean tree, stopped the daemon, removed the log file, installed the fresh git, and… I enter some sort of keypad and tapping around the position of 5 types 5 in a terminal, but there is no backlight.

This still works : sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x01 0xad turns it on. sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad turns if off.

Also still, the % touchpad-zone does the effect of what Ctrl-V does : it pastes the copy-paste buffer, but with two additional characters : «( and this time they are in front of the paste buffer. Yesterday they were at the end, according to the messages above. To make it clear, this is what I get when I type all positions in sequence, after having pasted the two lines above (so that's what is in the buffer), with focus in a terminal. Notice the parasite «( after the equal sign and before the paste:

marcel@ux582lr:~/asus-touchpad-numpad-driver$ 0.
0.: command not found
marcel@ux582lr:~/asus-touchpad-numpad-driver$ +123-456*789/=«) sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x01 0xad turns it on.
sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad turns if off

Here is the beginning of the log file :

marcel@ux582lr:~/asus-touchpad-numpad-driver$ cat /var/log/asus_touchpad_numpad-driver/error.log
INFO:asus-touchpad-numpad-driver:Detecting keyboard from string: "N: Name="AT Translated Set 2 keyboard""
INFO:asus-touchpad-numpad-driver:Set keyboard 3 from H: Handlers=sysrq kbd event3 leds
INFO:asus-touchpad-numpad-driver:Detecting touchpad from string: "N: Name="ELAN9009:00 04F3:2C23 Touchpad""
INFO:asus-touchpad-numpad-driver:Set touchpad device id 4 from S: Sysfs=/devices/pci0000:00/0000:00:15.3/i2c_designware.3/i2c-4/i2c-ELAN9009:00/0018:04F3:2C23.0003/input/input50
INFO:asus-touchpad-numpad-driver:Set touchpad id 29 from H: Handlers=mouse4 event29
INFO:asus-touchpad-numpad-driver:Detecting touchpad from string: "N: Name="ELAN1406:00 04F3:3101 Touchpad""
INFO:asus-touchpad-numpad-driver:Set touchpad device id 2 from S: Sysfs=/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-2/i2c-ELAN1406:00/0018:04F3:3101.0004/input/input53
INFO:asus-touchpad-numpad-driver:Set touchpad id 17 from H: Handlers=mouse6 event17
INFO:asus-touchpad-numpad-driver:Touchpad min-max: x 0-1792, y 0-2500
INFO:asus-touchpad-numpad-driver:Numpad min-max: x 80-1712, y 200-2420
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 1730 y 40
INFO:asus-touchpad-numpad-driver:Touched top_right_icon (numlock) in time: 1677145734.394337
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 1695 y 45
INFO:asus-touchpad-numpad-driver:The numpad numlock was pressed longer than the activation time: 3.117676019668579
INFO:asus-touchpad-numpad-driver:Activation time: 1.0
INFO:asus-touchpad-numpad-driver:Un-touched with NumberPad activation top_right_icon (numlock) in time: 1677145737.512521
INFO:asus-touchpad-numpad-driver:Numpad activated
INFO:asus-touchpad-numpad-driver:Setting up for config file key: "enabled" with value: "True"
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 222 y 1171
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 217 y 1173
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP4:75
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP4:75
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 814 y 1174
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 794 y 1177
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP5:76
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP5:76
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 1322 y 1239
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 1332 y 1250
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KPASTERISK:55
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KPASTERISK:55
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 802 y 1106
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 862 y 1104
INFO:asus-touchpad-numpad-driver:finger down at x 862 y 1104
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP5:76
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP5:76
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 231 y 1095
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 240 y 1086
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 912 y 1024
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 1477 y 1178
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 760 y 522
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 753 y 529
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:%
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:%
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 726 y 1086
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 724 y 1117
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 784 y 1568
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 790 y 1580
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP2:80
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP2:80
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 241 y 1845
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 261 y 1789
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP1:79
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP1:79
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 772 y 1722
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 764 y 1741
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP2:80
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KP2:80
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 1315 y 1805
INFO:asus-touchpad-numpad-driver:Ended existing slot
INFO:asus-touchpad-numpad-driver:finger down at x 1309 y 1791
INFO:asus-touchpad-numpad-driver:Pressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KPMINUS:74
INFO:asus-touchpad-numpad-driver:Unpressed numpad key
INFO:asus-touchpad-numpad-driver:KEY_KPMINUS:74
INFO:asus-touchpad-numpad-driver:Started new slot
INFO:asus-touchpad-numpad-driver:finger down at x 257 y 1143
INFO:asus-touchpad-numpad-driver:Ended existing slot
...
ldrahnik commented 1 year ago

@mbrouillet Please again try test_brightness.py from the latest master. Was backlight changed or not? About "%", did you installed sudo apt install -y ibus or not?

mbrouillet commented 1 year ago

@mbrouillet For using character % you have to be able use the shortcut Ctrl + Shift + U for sending unicode characters, more info here for example https://sysadmin-journal.com/insert-unicode-characters-in-kde-using-ctrl-u/, is required enable IBUS. Try to install sudo apt install -y ibus.

marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo apt install -y ibus
[sudo] password for marcel: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ibus is already the newest version (1.5.26-4).
ibus set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

(the 3 not upgraded are kept back, I'm not sure why, but should be no factor to the matter : grub-efi-amd64-bin grub-efi-amd64-signed shim-signed)

ldrahnik commented 1 year ago

@mbrouillet I am sorry, accidentally I pushed these lines to master:

    #try:
        #subprocess.call(cmd)
    #except subprocess.CalledProcessError as e:
    #    log.error('Error during sending via i2c: \"%s\"', e.output)

That is why does not work backlight atm. Is pushed to the master revert of these lines.

mbrouillet commented 1 year ago

@mbrouillet Please again try test_brightness.py from the latest master. Was backlight changed or not? About "%", did you installed sudo apt install -y ibus or not?

There seems to be indeed a sleep state of the touchpad. In the sequence below, first run (much faster than yesterday) yield nothing. Then I forced backlight on, backlight off, Then second run works with different levels. The intensity levels vary and don't seem in order. Would you like me to film them ?

marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo python3 ./tests/test_brightness.py
Hight bright
1 0x1
11 0xb
81 0x51
131 0x83
161 0xa1
181 0xb5
231 0xe7
241 0xf1
middle bright
21 0x15
41 0x29
51 0x33
61 0x3d
71 0x47
91 0x5b
101 0x65
111 0x6f
121 0x79
141 0x8d
151 0x97
171 0xab
201 0xc9
low bright
31 0x1f
marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x01 0xad
marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo i2ctransfer -f -y 2 w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad
marcel@ux582lr:~/asus-touchpad-numpad-driver$ sudo python3 ./tests/test_brightness.py
Hight bright
1 0x1
11 0xb
81 0x51
131 0x83
161 0xa1
181 0xb5
231 0xe7
241 0xf1
middle bright
21 0x15
41 0x29
51 0x33
61 0x3d
71 0x47
91 0x5b
101 0x65
111 0x6f
121 0x79
141 0x8d
151 0x97
171 0xab
201 0xc9
low bright
31 0x1f
marcel@ux582lr:~/asus-touchpad-numpad-driver$
ldrahnik commented 1 year ago

@mbrouillet Does with latest master backlight works? Is enabled with NumberPad activation? If is the answer yes, please try to hold your finger on the top left for fluent brightness change, there should be in order.

ldrahnik commented 1 year ago

@mbrouillet Please try in terminal touch together CTRL + SHIFT + U, release all of them, and then touch 2, release 2 then touch 5, release 5 and press enter. Should be written '%'. Install second EN keyboard layout in case FR does not support numbers above QWERTZ line.

mbrouillet commented 1 year ago

@mbrouillet I am sorry, accidentally I pushed these lines to master…

Fresh install, seems to work great ! Thank you. I'll keep you posted, and I'll add my notes regarding sound to your drivers notes.

I'm not too sure what to do with the % key. Actually paste is a nice feature, except there are those two parasite characters. I don't understand what I should do with ibus and an unicode input (% is an ascii character, not ?), but it really is not important.

Nor do I understand what to do to launch an application (calculator) to the right corner. I believe there should be something under org.gnome.settings-daemon.plugins.media-keys, I probably need to set it using gsettings ; is it the location of the calculator (/usr/bin/kcalc) ?

And I'll try to adjust the brightness to a correct level. Do you recommend touching /usr/share/asus_touchpad_numpad-driver/asus_touchpad_numpad_dev directly ? or should I adjust my local value and run install again ?

ldrahnik commented 1 year ago

And I'll try to adjust the brightness to a correct level. Do you recommend touching /usr/share/asus_touchpad_numpad-driver/asus_touchpad_numpad_dev directly ? or should I adjust my local value and run install again ?

@mbrouillet Activate NumberPad and hold the top left icon for brightness change and stop when is brightness fit for you. Your selected brightness level will be automatically set up each laptop / NumberPad start and when debugging often (sudo ./install.sh and sudo ./uninstall.sh) just do not remove the config file and keep him for the next installation.

Manually setting in the config file you set up one from these values (does not exist more valid values as far as I know):

    "0x41",
    "0x42",
    "0x43",
    "0x44",
    "0x45",
    "0x46"

In case when was running test_brightness.py and you think more levels was there shown I would need that video probably, otherwise not.

mbrouillet commented 1 year ago

@mbrouillet Does with latest master backlight works? Is enabled with NumberPad activation? If is the answer yes, please try to hold your finger on the top left for fluent brightness change, there should be in order.

Indeed, it cycles, but I have the impression I saw dimmer settings running the test, especially the lowest one. Here are two videos. My phone adjusts the brightness unfortunately. I did a second run with a white page and the terminal, to try to avoid the phone to brightness changes. https://fromsmash.com/nYdlZgOL.O-dt I don't think cycling through the levels using the left corners goes as low as the last setting.

mbrouillet commented 1 year ago

@mbrouillet Please try in terminal touch together CTRL + SHIFT + U, release all of them, and then touch 2, release 2 then touch 5, release 5 and press enter. Should be written '%'. Install second EN keyboard layout in case FR does not support numbers above QWERTZ line.

This does indeed work, in both keyboard layouts. I get an underlined u, then u2, then it gets replaced by %.

mbrouillet commented 1 year ago

The % key does indeed enter a % when layout is EN. When layout is FR Bépo, it does «) [which is the keys 2 and 5 in EN] followed by CTRL-V (not too sure why). It's not fundamental for me to have the % key ; but I'm happy finding a aesthetic solution to this. Note that if shift was emulated, it would enter 2 and 5.

mbrouillet commented 1 year ago

@mbrouillet I could merge that sound to work to asus random useful notes repository, feel free to make a pull request so you will be displayed as a contributor (in case you think it is useful for others / others have the same problem, i did not read that thread)

I did clone, edit, and commit. Should I run git push or are you reviewing my mods first ?

ldrahnik commented 1 year ago

@mbrouillet Which one on the screen is closest similar to that used by you? image

mbrouillet commented 1 year ago

@mbrouillet Which one on the screen is closest similar to that used by you? image

What I use is French (Bepo, ergonomic, Dvorak way) and I've not seen any difference with the AFNOR or not.

mbrouillet commented 1 year ago

This is how I've sorted the brightness levels on my computer. I can distinguish 8 levels, although the steps between the first ones are clear, and the five last one are very subtle changes. But the last one is brighter than the fifth… Maybe by looking at the binary, it tells a sequence ? An in some cases, I was about to permutate one or two numbers, it is not very clear so subtle are the differences in the bright values.

marcel@ux582lr:~/asus-touchpad-numpad-driver$ git diff
diff --git a/tests/test_brightness.py b/tests/test_brightness.py
index d8aea6d..2fdbbd1 100644
--- a/tests/test_brightness.py
+++ b/tests/test_brightness.py
@@ -46,30 +46,41 @@ with open('/proc/bus/input/devices', 'r') as f:
                #if keyboard_detected == 2 and touchpad_detected == 2:
                #       break

-s1 = [1, 11,  81, 131, 161, 181, 231, 241]
-s2 = [21, 41, 51, 61, 71, 91, 101, 111, 121, 141, 151, 171, 201]
-s3 = [31]
-
-print("Hight bright")
-for i in range(len(s1)):
-       print(s1[i], hex(s1[i]))
-       cmdon = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 " + str(hex(s1[i])) + " 0xad"
-       os.system(cmdon)
-       sleep(1)
-
-print("middle bright")
-for i in range(len(s2)):
-       print(s2[i], hex(s2[i]))
-       cmdon = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 " + str(hex(s2[i])) + " 0xad"
-       os.system(cmdon)
-       sleep(1)
-
-print("low bright")
-for i in range(len(s3)):
-       print(s3[i], hex(s3[i]))
-       cmdon = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 " + str(hex(s3[i])) + " 0xad"
-       os.system(cmdon)
-       sleep(1)
-       sleep(1)
+#s1 = [1, 11,       131, 181, 231,     81, 161, 241]
+#s2 = [21, 41, 61,          111, 91,   71, 141,          121, 171,  51,        101, 151, 201]
+s0 = [31] # clear
+s1 = [21, 41, 61] # clear
+s2 = [111, 91] # clear
+s3 = [71, 141, 121] # clear
+s4 = [51, 171]
+s5 = [101, 151, 201]
+s6 = [1, 11]
+s7 = [131, 181, 231]
+s8 = [81, 161, 241]
+
+for s in [s0, s1, s2, s3, s4, s5, s6, s7, s8]:
+       print("next level")
+       for i in range(len(s)):
+               print(s[i], hex(s[i]))
+               cmdon = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 " + str(hex(s[i])) + " 0xad"
+               os.system(cmdon)
+               sleep(0.5)
+       print("")
+       sleep(3)
+
+#print("middle bright")
+#for i in range(len(s2)):
+#      print(s2[i], hex(s2[i]))
+#      cmdon = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 " + str(hex(s2[i])) + " 0xad"
+#      os.system(cmdon)
+#      sleep(1)
+
+#print("Hight bright")
+#for i in range(len(s1)):
+#      print(s1[i], hex(s1[i]), "\a")
+#      cmdon = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 " + str(hex(s1[i])) + " 0xad"
+#      os.system(cmdon)
+#      sleep(1)

 cmdoff = "i2ctransfer -f -y " + device_id + " w13@0x15 0x05 0x00 0x3d 0x03 0x06 0x00 0x07 0x00 0x0d 0x14 0x03 0x00 0xad"

Manually setting in the config file you set up one from these values (does not exist more valid values as far as I know):

    "0x41",
    "0x42",
    "0x43",
    "0x44",
    "0x45",
    "0x46"

I get completely different levels. In fact, I don't see these values in the arrays that you had set up s1 s2 s3. My process was to rearrange numbers within each array, by luminosity increasing. I think keeping my s0 s1 s2 s3 and then s8 would give good values, and pick any of the different values for each array.

ldrahnik commented 1 year ago

@mbrouillet I could merge that sound to work to asus random useful notes repository, feel free to make a pull request so you will be displayed as a contributor (in case you think it is useful for others / others have the same problem, i did not read that thread)

I did clone, edit, and commit. Should I run git push or are you reviewing my mods first ?

Please make a pull request, I will review the changes.

ldrahnik commented 1 year ago

@mbrouillet

When layout is FR Bépo, it does «) [which is the keys 2 and 5 in EN] followed by CTRL-V (not too sure why)

Now should be used 2 and 5 for FR Bépo keyboard aswell (pushed to master), unfortunately, will not be printed character "%" yet because FR Bépo keyboard has under "U" character "V".

ldrahnik commented 1 year ago

@mbrouillet Please, when you run $ ibus-setup what do you see on page Emoji and under label Unicode code point?

mbrouillet commented 1 year ago

@mbrouillet

When layout is FR Bépo, it does «) [which is the keys 2 and 5 in EN] followed by CTRL-V (not too sure why)

Now should be used 2 and 5 for FR Bépo keyboard aswell (pushed to master), unfortunately, will not be printed character "%" yet because FR Bépo keyboard has under "U" character "V".

I see. Indeed, in most layouts U stays in the same place I presume, but here it is V (which explains the paste of the buffer).

How about saving the output of setxkbmap -print, change the layout to US, issue Ctrl-U 2 5, and reset the layout back ? Optionally for many layouts (have a list, but most european and american) you can save the switch. Just an idea… but I agree that changing the layout back and forth at a keypress seems not the greatest idea either.

mbrouillet commented 1 year ago

@mbrouillet Please, when you run $ ibus-setup what do you see on page Emoji and under label Unicode code point?

It tells me IBus was not started. Note : Ubuntu Studio is basically a Kubuntu. Is there something different in KDE ? Then

IBus has been started! If you cannot use IBus, add the following lines to your $HOME/.bashrc; then relog into your desktop.
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus

and under Emoji - Unicode code point <Control><Shift>u

I do use <Control><Shift>u followed by unicode sequence sometimes myself. But indeed, I press the U on the « S » key of the US layout.

mbrouillet commented 1 year ago

Please make a pull request, I will review the changes.

I am quite new to Git. I'm an old-schooler using cvs and so far had never had a need to use git other than a local clone. I think I made a mistake as I should have done a local branch. What I did is a commit. I think my modifications are local but not on a separate branch. What should I do from here ?

marcel@ux582lr:~/asus-random-notes$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
marcel@ux582lr:~/asus-random-notes$ 
mbrouillet commented 1 year ago

This is how I've sorted the brightness levels on my computer. I can distinguish 8 levels, although the steps between the first ones are clear, and the five last one are very subtle changes. But the last one is brighter than the fifth…

BTW, can you explain the relationship between the values in your s1, s2, s3 arrays, and the 0x41 to 0x46 ? I'd like to change the values of the layout backlight_levels array, but putting values from my eight arrays (from modified brightness test script) did not work.

ldrahnik commented 1 year ago

@mbrouillet

In the branch #98 In master should "%" in FR Bépo keyboard layout works. In the code still remain 1 TODO for test it on wayland (not pushed to master yet). Can you test latest master that branch please and confirm it works for you? I installed your keyboard layout and it works for me.

ldrahnik commented 1 year ago

@mbrouillet

I am quite new to Git. I'm an old-schooler using cvs and so far had never had a need to use git other than a local clone. I think I made a mistake as I should have done a local branch. What I did is a commit. I think my modifications are local but not on a separate branch. What should I do from here ?

You have to do a fork of original repository under this org (it can be done in user interface of github), the repository will appears on your github profile, then git clone fork of original repository from your profile, make a branch git branch name-for-branch-how-to-fix-sound, git commit .., git push, then in UI of the original repository create Pull request.

ldrahnik commented 1 year ago

@mbrouillet Curl error was because 2 ELAN drivers have been detected on your laptop (pushed to master)

ldrahnik commented 1 year ago

@mbrouillet Backlight levels which are currently used in the driver (and which work for me) in decimal form (as is usual in test_brightness file):

s = [65, 66, 67, 68, 69, 70]

in hex form as is required in numpad layout files:

    "0x41",
    "0x42",
    "0x43",
    "0x44",
    "0x45",
    "0x46"

First one: 65 in decimal = 4 16^1 + 1x 16^0 (16^0 = 1) = 4 16 + 1 = 41 in hex form

Remember, value 0x01 which enables NumberPad backlight automatically set lastly used level. Does not work between restarts, for keeping last brightness between restarts is the last used level of brightness saved to the config file.