iamkroot / asus-numpad

Linux driver for Asus laptops to activate numpad on touchpad
MIT License
34 stars 10 forks source link

Drag to trigger calculator does not works #2

Closed franckgaga closed 2 years ago

franckgaga commented 2 years ago

Hi,

Thanks for sharing your work!

I tried all the possible drag movement and the calculator does not show I'm using a Zenbook UX425EA running Pop!_OS 21.10 (same calculator app as Ubunutu) It does works on windows 10 (by dragging from-top left to top-right of the mousepad)

iamkroot commented 2 years ago

The drag to trigger calc feature is currently being re-written. So it might be better to wait for the next release to try it.

How to Debug

  1. You need to get the debug build of asus-numpad in order to enable logging. For now, this means you'll need to install the Rust toolchain (https://rustup.rs), since I'm not providing pre-built debug binaries.
  2. Once you have the Rust toolchain installed, you can run sudo -E cargo install --root /usr --git="https://github.com/iamkroot/asus-numpad" --tag=v0.3.0 --debug to install the debug version.
  3. To run with debug logs, run RUST_LOG=debug asus-numpad --layout=...
iamkroot commented 2 years ago

I've released v0.4, and also uploaded the debug version so you that wouldn't have to build it manually. Keep in mind that the installation instructions have changed, so you might want to start from a clean slate. Once installed, just try step 3 from previous comment to start printing debug logs. If you can't figure out what the issue is, paste the logs here.

iamkroot commented 2 years ago

Hmm before all this, try the following:

Or, with the latest version, you can specify gnome-calculator as your calc_start_command.

franckgaga commented 2 years ago

I've just noticed that it does work with my version (v0.3) but only when the when the numpad is off. Is it possible to make the drag movement works also when the numpad is on (light on) ?

Thanks !

iamkroot commented 2 years ago

Not really, that would conflict with the "tap calc button to change brightness" gesture. I think the Windows driver also behaves similarly.

franckgaga commented 2 years ago

That's a good point. I'm not sure about the Windows drive. I will uninstall v0.3, install 0.4 and give you a feedback soon.

Thanks

franckgaga commented 2 years ago

Installed v0.4 and everything work as intended, calculator included, thanks !

iamkroot commented 2 years ago

Is it possible to make the drag movement works also when the numpad is on (light on) ?

I revisited the code and it was fairly simple to support this feature. The nuance was that brightness is changed when you hold the calc button, so it is ok to allow the drag gesture. (Windows behaves the same way).

Will be released in the next version.

franckgaga commented 2 years ago

@iamkroot I'm trying to map SUPER+Q on calc_stop_command (that closes the window on pop_os). it does not close the calc window. Is my configuration seems ok to you :

calc_stop_command = ["KEY_LEFTMETA","KEY_Q"]

Thanks for your help!

iamkroot commented 2 years ago

The keys seem to be correct at least. But Linux DEs usually have trouble dealing with shortcuts with the Meta key, especially when trying to generate them from a non-physical keyboard.

If you were on KDE, I'd say there is a way to bypass the shortcut and directly use QDBUS to run the "close window" command. I'm not too well versed with GNOME to know if there's an equivalent for that. Nevertheless, here's an article that explains how to discover if there's a way to do it using DBUS.

Another option might be to set the stop command to something like pkill __calculate_exec_name__ (where the name is whatever pop_os uses as calc), using variant b in the config description. That way, if the calc is open, it'll get killed.