You are not logged in.

#1 2017-05-22 18:45:30

dricky
Member
Registered: 2017-03-18
Posts: 4

ASUS FlipLock (automatic touchpad toggling for 2 in 1 laptop)

Recently installed arch on an Asus Q551Ln 2 in 1 laptop. Believe this model is related to most of the TP500 line. The majority works out of the box, or by following normal procedures to get working.

Only two things weren't working, flip lock and the accelerometer / gyro. The accelerometer doesn't matter much, at least to me, being a 15" laptop its a rather large and heavy for regular tablet usage.

Asus Fliplock is just a windows program to disable the keyboard and touchpad while the laptop is in tablet mode, or technically whenever the screen hinge goes past 180 degrees. The keyboard was being disabled out of the box, not sure if in hardware or in the asus-nb-wmi module, but the touchpad was still active. Searching for answers to how to automate disabling the touchpad led me no where. But I noticed while switching TTYs that the monitor crossing the 180 degree mark created a key press in the login field.

I used xbindkeys find and bind that key press to the same touchpad toggle script I used for the FN+F9 hotkey and voila automated touchpad toggling.

$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x10 + c:248
    Mod2 + NoSymbol

and put below into .xbindkeysrc my keycode was "m:0x10 + c:248" but this may vary.

#Toggle Touchpad with Tablet Mode
"bash /path/to/touchpadtoggle.sh"
  m:0x10 + c:248

touchpadtoggle.sh is just a simple toggle script to enable and disable touchpad which I found online, my touchpad is device 14 which I found with 'xinput list'

#!/bin/bash

device=14
state=`xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$"`

if [ $state == '1' ];then
  xinput --disable $device
else
  xinput --enable $device
fi

This should work with any asus 2 in 1 one that offers fliplock in windows, and most likely any other 2 in 1 that offers the same functionality of fliplock.

Last edited by dricky (2017-05-22 18:48:31)

Offline

#2 2017-11-16 17:46:37

dricky
Member
Registered: 2017-03-18
Posts: 4

Re: ASUS FlipLock (automatic touchpad toggling for 2 in 1 laptop)

Only issue I have found with this is that plugging in the ac power adapter creates the same keypress as flipping the screen. Not sure if there is anyway around this.

If anyone has an idea of where to start looking to either disable the key press created by plugging in the ac adapter or to to change it it would be much appreciated. Either way having to just re-enable the touchpad after plugging it in is much easier than having to remember to disable it everytime i flip into tablet mode.

Could probably script in a way to first check if the ac adapter was just plugged in and if so do nothing.

Last edited by dricky (2017-11-16 17:50:20)

Offline

#3 2017-11-17 02:23:16

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: ASUS FlipLock (automatic touchpad toggling for 2 in 1 laptop)

If this is meant to be in the forums at all, it should probably be in Community Contributions.

That being said, I think this makes more sense on the wiki.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB