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

flip() does not send SW_TABLET_MODE event on ASUS EXPERTBOOK B2502FBA #4

Closed
Geras1mleo opened this issue Jan 27, 2024 · 7 comments · Fixed by #5
Closed

flip() does not send SW_TABLET_MODE event on ASUS EXPERTBOOK B2502FBA #4

Geras1mleo opened this issue Jan 27, 2024 · 7 comments · Fixed by #5
Assignees
Labels
bug Something isn't working

Comments

@Geras1mleo
Copy link
Contributor

Hi there!

OS: Ubuntu 22.04.1
Kernel: 6.5.0-15-generic
Dual boot with Windows 11

I've issues with enabling my keyboard on my 2 in 1 ASUS.
On Windows everything works fine, on Linux only some function (Fn + key) keys work, rest of the keyboard is not working at all.

First I just ran the service and it did nothing, so I tried to debug it and saw the following:

flip(False) function is sending these events (1 iteration and exit):

[InputEvent(EV_KEY, KEY_PROG2, 1)]
[InputEvent(EV_KEY, KEY_PROG2, 0)]
[InputEvent(EV_SW, SW_TABLET_MODE, 0)]

On the other side, libinput debug-events receives following events:

$ sudo libinput debug-events
-event18  DEVICE_ADDED            Video Bus                         seat0 default group1  cap:k
-event0   DEVICE_ADDED            Power Button                      seat0 default group2  cap:k
-event1   DEVICE_ADDED            Lid Switch                        seat0 default group3  cap:S
-event11  DEVICE_ADDED            Logitech USB Keyboard             seat0 default group4  cap:k
-event12  DEVICE_ADDED            Logitech USB Keyboard Consumer Control seat0 default group4  cap:k
-event13  DEVICE_ADDED            Logitech USB Keyboard System Control seat0 default group4  cap:k
-event3   DEVICE_ADDED            ELAN9008:00 04F3:2F61             seat0 default group5  cap:t  size 332x188mm ntouches 10 calib
-event6   DEVICE_ADDED            ELAN9008:00 04F3:2F61 Stylus      seat0 default group5  cap:T  size 343x194mm calib
-event9   DEVICE_ADDED            ASUE1201:00 04F3:3148             seat0 default group6  cap:p left scroll-nat scroll-button
-event10  DEVICE_ADDED            ASUE1201:00 04F3:3148             seat0 default group6  cap:pg  size 103x58mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
-event17  DEVICE_ADDED            ASUE1201:00 04F3:3148             seat0 default group6  cap:p left scroll-nat scroll-button
-event14  DEVICE_ADDED            Intel HID events                  seat0 default group7  cap:k
-event15  DEVICE_ADDED            Intel HID 5 button array          seat0 default group8  cap:k
-event24  DEVICE_ADDED            Intel HID switches                seat0 default group9  cap:S
-event2   DEVICE_ADDED            Asus WMI hotkeys                  seat0 default group10 cap:k
-event11  KEYBOARD_KEY            +0.000s	*** (-1) pressed
 event11  KEYBOARD_KEY            +0.056s	*** (-1) pressed
 event11  KEYBOARD_KEY            +0.112s	*** (-1) released
 event11  KEYBOARD_KEY            +0.152s	*** (-1) released
 event11  KEYBOARD_KEY            +0.448s	KEY_UP (103) pressed
 event11  KEYBOARD_KEY            +0.512s	KEY_UP (103) released
 event11  KEYBOARD_KEY            +1.120s	*** (-1) pressed
 event11  KEYBOARD_KEY            +1.184s	*** (-1) released
-event23  DEVICE_ADDED            Asus WMI accel tablet mode        seat0 default group11 cap:kS
 event23  KEYBOARD_KEY            +2.236s	KEY_PROG2 (149) pressed
 event23  KEYBOARD_KEY            +2.236s	KEY_PROG2 (149) released
 event23  DEVICE_REMOVED          Asus WMI accel tablet mode        seat0 default group11 cap:kS

The driver is running with event23 and as you can see, no SW_TABLET_MODE visible...
I ran the driver not as a service but in shell (with sudo) after sudo libinput debug-events.

My goal at the moment is just to disable tablet mode (or switch into laptop mode) to be able to use my built in keyboard...

I would really appreciate any help, so let me know if you need more logs or any extra details.

Thank you in advance!

@ldrahnik
Copy link
Member

ldrahnik commented Jan 27, 2024

@Geras1mleo Hi,

On Windows everything works fine, on Linux only some function (Fn + key) keys work, rest of the keyboard is not working at all.

For Fn + keys with no kernel support yet try this driver (own configuration needed, I use it for fix microphone/camera LEDs and more)

I merged your #5, sorry for that.

@ldrahnik
Copy link
Member

ldrahnik commented Jan 27, 2024

@Geras1mleo IMHO you do not need this driver because your hw is Intel, it should work out-of-the-box, event should be sent by this device:

...
-event24  DEVICE_ADDED            Intel HID switches                seat0 default group9  cap:S
...

Atm I have again laptop with Intel UP5401EA and I see:

$ uname -r
6.5.0-14-generic

$ sudo libinput debug-events

-event2   DEVICE_ADDED            Power Button                      seat0 default group1  cap:k
-event14  DEVICE_ADDED            Video Bus                         seat0 default group2  cap:k
-event0   DEVICE_ADDED            Lid Switch                        seat0 default group3  cap:S
-event1   DEVICE_ADDED            Power Button                      seat0 default group4  cap:k
-event5   DEVICE_ADDED            ELAN9009:00 04F3:2E36             seat0 default group5  cap:t  size 300x184mm ntouches 10 calib
-event8   DEVICE_ADDED            ELAN9009:00 04F3:2E36 Stylus      seat0 default group5  cap:T  size 300x190mm calib
-event11  DEVICE_ADDED            ASUE140D:00 04F3:31B9 Mouse       seat0 default group6  cap:p left scroll-nat scroll-button
-event12  DEVICE_ADDED            ASUE140D:00 04F3:31B9 Touchpad    seat0 default group6  cap:pg  size 125x72mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
-event13  DEVICE_ADDED            ASUE140D:00 04F3:31B9 Keyboard    seat0 default group6  cap:k
-event15  DEVICE_ADDED            Intel HID events                  seat0 default group7  cap:k
-event23  DEVICE_ADDED            Intel HID switches                seat0 default group8  cap:S
-event4   DEVICE_ADDED            Asus WMI hotkeys                  seat0 default group9  cap:k
-event3   DEVICE_ADDED            AT Translated Set 2 keyboard      seat0 default group10 cap:k
-event21  DEVICE_ADDED            ASUE140D:00 04F3:31B9 NumberPad   seat0 default group11 cap:kp left scroll-nat
-event22  DEVICE_ADDED            Asus WMI hotkeys                  seat0 default group12 cap:k
-event23  SWITCH_TOGGLE           +0.000s	switch tablet-mode state 1
-event4   KEYBOARD_KEY            +0.000s	KEY_PROG2 (149) pressed
 event4   KEYBOARD_KEY            +0.000s	KEY_PROG2 (149) released
-event23  SWITCH_TOGGLE           +3.996s	switch tablet-mode state 0
-event4   KEYBOARD_KEY            +3.996s	KEY_PROG2 (149) pressed
 event4   KEYBOARD_KEY            +3.996s	KEY_PROG2 (149) released

@ldrahnik ldrahnik linked a pull request Jan 27, 2024 that will close this issue
@ldrahnik
Copy link
Member

ldrahnik commented Jan 27, 2024

@Geras1mleo Try logging into Windows and do a flip to the tablet mode and back. I had problem once it was stuck somehow and this helped me.

@ldrahnik ldrahnik self-assigned this Jan 27, 2024
@ldrahnik ldrahnik added the bug Something isn't working label Jan 27, 2024
@Geras1mleo
Copy link
Contributor Author

@ldrahnik well, i tried with different distros (thought it was gnome's bug) such as arch and ubuntu, then with different kernels and nothing really changed... also blacklisted some intel modules as some people recommended, but still no result. My last attempt was to force send sw_tablet_mode to trigger something in kernel and begin accept events from the keyboard, but didn't work either...
The funniest is that everything works perfectly on Windows...

@Geras1mleo
Copy link
Contributor Author

@Geras1mleo IMHO you do not need this driver because your hw is Intel, it should work out-of-the-box, event should be sent by this device:

...
-event24  DEVICE_ADDED            Intel HID switches                seat0 default group9  cap:S
...

Atm I have again laptop with Intel UP5401EA and I see:

$ uname -r
6.5.0-14-generic

$ sudo libinput debug-events

-event2   DEVICE_ADDED            Power Button                      seat0 default group1  cap:k
-event14  DEVICE_ADDED            Video Bus                         seat0 default group2  cap:k
-event0   DEVICE_ADDED            Lid Switch                        seat0 default group3  cap:S
-event1   DEVICE_ADDED            Power Button                      seat0 default group4  cap:k
-event5   DEVICE_ADDED            ELAN9009:00 04F3:2E36             seat0 default group5  cap:t  size 300x184mm ntouches 10 calib
-event8   DEVICE_ADDED            ELAN9009:00 04F3:2E36 Stylus      seat0 default group5  cap:T  size 300x190mm calib
-event11  DEVICE_ADDED            ASUE140D:00 04F3:31B9 Mouse       seat0 default group6  cap:p left scroll-nat scroll-button
-event12  DEVICE_ADDED            ASUE140D:00 04F3:31B9 Touchpad    seat0 default group6  cap:pg  size 125x72mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
-event13  DEVICE_ADDED            ASUE140D:00 04F3:31B9 Keyboard    seat0 default group6  cap:k
-event15  DEVICE_ADDED            Intel HID events                  seat0 default group7  cap:k
-event23  DEVICE_ADDED            Intel HID switches                seat0 default group8  cap:S
-event4   DEVICE_ADDED            Asus WMI hotkeys                  seat0 default group9  cap:k
-event3   DEVICE_ADDED            AT Translated Set 2 keyboard      seat0 default group10 cap:k
-event21  DEVICE_ADDED            ASUE140D:00 04F3:31B9 NumberPad   seat0 default group11 cap:kp left scroll-nat
-event22  DEVICE_ADDED            Asus WMI hotkeys                  seat0 default group12 cap:k
-event23  SWITCH_TOGGLE           +0.000s	switch tablet-mode state 1
-event4   KEYBOARD_KEY            +0.000s	KEY_PROG2 (149) pressed
 event4   KEYBOARD_KEY            +0.000s	KEY_PROG2 (149) released
-event23  SWITCH_TOGGLE           +3.996s	switch tablet-mode state 0
-event4   KEYBOARD_KEY            +3.996s	KEY_PROG2 (149) pressed
 event4   KEYBOARD_KEY            +3.996s	KEY_PROG2 (149) released

You are right! It is sending the event, and I thought it was the wrong one, but now I see that you get the same SWITCH_TOGGLE event... okey, seems like the issue lies somewhere else than...
Thank you!

@ldrahnik
Copy link
Member

ldrahnik commented Jan 27, 2024

Nice, so now you just need flip-lock driver to react properly to each state (disable / enable what is not handled by distro by default) https://github.com/asus-linux-drivers/asus-fliplock-driver ; )

@Geras1mleo
Copy link
Contributor Author

Hope this will work, will try it tomorrow 🤞

Thank you for your drivers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants