Bug 320506 - no response when touchpad toggle key was pressed (Fn key)
Summary: no response when touchpad toggle key was pressed (Fn key)
Status: RESOLVED FIXED
Alias: None
Product: ktouchpadenabler
Classification: Miscellaneous
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-31 00:10 UTC by Cloud Han
Modified: 2013-08-11 14:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0


Attachments
test.pro (325 bytes, text/plain)
2013-06-11 21:52 UTC, Albert Astals Cid
Details
main.cpp (4.02 KB, text/plain)
2013-06-11 21:52 UTC, Albert Astals Cid
Details
New main.cpp file (5.99 KB, text/x-c++src)
2013-06-15 17:15 UTC, Albert Astals Cid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cloud Han 2013-05-31 00:10:48 UTC
Just no response in latest Archlinux with KDE 4.10 and kernel 3.9.4

Reproducible: Always

Steps to Reproduce:
1. press you Fn key
2. no response
3. again
Actual Results:  
can't toggle touchpad status on laptop

Expected Results:  
toggle touchpad status
Comment 1 Albert Astals Cid 2013-05-31 16:50:51 UTC
Can you please run
  qdbus org.kde.kded /kded loadedModules | grep ktouch
to make sure ktouchpadenabler is loaded?
Comment 2 Cloud Han 2013-06-01 01:43:07 UTC
(In reply to comment #1)
> Can you please run
>   qdbus org.kde.kded /kded loadedModules | grep ktouch
> to make sure ktouchpadenabler is loaded?

yes, I got 
ktouchpadenabler
from the command.
Comment 3 Albert Astals Cid 2013-06-01 13:08:31 UTC
Ok, can you try this?

$ qdbus org.kde.kded /kded unloadModule ktouchpadenabler

This unloads ktouchpadenabler, now start xev

$ xev

and press the the Fn key for togglign the touchpad, you should get something like

KeyPress event, serial 37, synthetic NO, window 0x6200001,
    root 0x9d, subw 0x0, time 7825804, (896,886), root:(899,909),
    state 0x0, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6200001,
    root 0x9d, subw 0x0, time 7825868, (896,886), root:(899,909),
    state 0x0, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Comment 4 Cloud Han 2013-06-01 13:59:27 UTC
(In reply to comment #3)
> Ok, can you try this?
> 
> $ qdbus org.kde.kded /kded unloadModule ktouchpadenabler
> 
> This unloads ktouchpadenabler, now start xev
> 
> $ xev
> 
> and press the the Fn key for togglign the touchpad, you should get something
> like
> 
> KeyPress event, serial 37, synthetic NO, window 0x6200001,
>     root 0x9d, subw 0x0, time 7825804, (896,886), root:(899,909),
>     state 0x0, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle),
> same_screen YES,
>     XLookupString gives 0 bytes: 
>     XmbLookupString gives 0 bytes: 
>     XFilterEvent returns: False
> 
> KeyRelease event, serial 40, synthetic NO, window 0x6200001,
>     root 0x9d, subw 0x0, time 7825868, (896,886), root:(899,909),
>     state 0x0, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle),
> same_screen YES,
>     XLookupString gives 0 bytes: 
>     XFilterEvent returns: False

*Before* unload, I got this:

KeyPress event, serial 40, synthetic NO, window 0x4e00001,
    root 0x93, subw 0x0, time 19034173, (540,39), root:(601,625),
    state 0x10, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

After :

KeyRelease event, serial 41, synthetic NO, window 0x4e00001,
    root 0x93, subw 0x0, time 19220282, (641,-15), root:(702,571),
    state 0x10, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False


seems in openSUSE, I got a table with two columns of numbers
Comment 5 Cloud Han 2013-06-01 14:00:53 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Ok, can you try this?
> > 
> > $ qdbus org.kde.kded /kded unloadModule ktouchpadenabler
> > 
> > This unloads ktouchpadenabler, now start xev
> > 
> > $ xev
> > 
> > and press the the Fn key for togglign the touchpad, you should get something
> > like
> > 
> > KeyPress event, serial 37, synthetic NO, window 0x6200001,
> >     root 0x9d, subw 0x0, time 7825804, (896,886), root:(899,909),
> >     state 0x0, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle),
> > same_screen YES,
> >     XLookupString gives 0 bytes: 
> >     XmbLookupString gives 0 bytes: 
> >     XFilterEvent returns: False
> > 
> > KeyRelease event, serial 40, synthetic NO, window 0x6200001,
> >     root 0x9d, subw 0x0, time 7825868, (896,886), root:(899,909),
> >     state 0x0, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle),
> > same_screen YES,
> >     XLookupString gives 0 bytes: 
> >     XFilterEvent returns: False
> 
> *Before* unload, I got this:
> 
> KeyPress event, serial 40, synthetic NO, window 0x4e00001,
>     root 0x93, subw 0x0, time 19034173, (540,39), root:(601,625),
>     state 0x10, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle),
> same_screen YES,
>     XLookupString gives 0 bytes: 
>     XmbLookupString gives 0 bytes: 
>     XFilterEvent returns: False
> 
> After :
> 
> KeyRelease event, serial 41, synthetic NO, window 0x4e00001,
>     root 0x93, subw 0x0, time 19220282, (641,-15), root:(702,571),
>     state 0x10, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle),
> same_screen YES,
>     XLookupString gives 0 bytes: 
>     XFilterEvent returns: False
> 
> 
> seems in openSUSE, I got a table with two columns of numbers

Oh, forgot the press event after unloading:

KeyPress event, serial 41, synthetic NO, window 0x4e00001,
    root 0x93, subw 0x0, time 19220442, (641,-15), root:(702,571),
    state 0x10, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x4e00001,
    root 0x93, subw 0x0, time 19220442, (641,-15), root:(702,571),
    state 0x10, keycode 199 (keysym 0x1008ffa9, XF86TouchpadToggle), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Comment 6 Albert Astals Cid 2013-06-01 14:07:14 UTC
Hmmm, you should not be seeing the keypresses/releases when ktouchpadenabler is loaded, do you see any ktouchpadenabler warning in .xsession-errors?

grep ktouchpadenabler .xsession-errors
Comment 7 Albert Astals Cid 2013-06-01 14:07:39 UTC
to load it again

qdbus org.kde.kded /kded loadModule ktouchpadenabler
Comment 8 Cloud Han 2013-06-01 14:13:14 UTC
no, there is no warning about ktouch.
Comment 9 Albert Astals Cid 2013-06-01 14:30:38 UTC
I'm kind of out of ideas now. If i give you a simple C++ code to try some stuff on your system, do you think you can compile it and run it? It's a few commands only
Comment 10 Cloud Han 2013-06-01 14:40:54 UTC
maybe, I'll try.
Comment 11 Cloud Han 2013-06-01 15:04:58 UTC
So, come on, it's late in Asia, 11 p.m.
Comment 12 Albert Astals Cid 2013-06-01 15:10:17 UTC
I'm busy preparing the code, maybe it'll take a few hours, just read your email the following days and we can continue, there's no need to do it *now*
Comment 13 Cloud Han 2013-06-01 15:15:57 UTC
Well, you mean *simple code*... so got it, I'll when you are done the code. :)
Comment 14 Albert Astals Cid 2013-06-11 21:49:11 UTC
Hi there, sorry for the delay, i'll be attaching two files, test.pro and main.cpp, download them both, put them inside a temporary folder and run
  qmake
  make
  ./test
and attach the result, you'll need to have the libqt4-dev, libxi-dev, and libx11-dev (package names may vary depending on your distro)
Comment 15 Albert Astals Cid 2013-06-11 21:52:36 UTC
Created attachment 80459 [details]
test.pro
Comment 16 Albert Astals Cid 2013-06-11 21:52:59 UTC
Created attachment 80460 [details]
main.cpp
Comment 17 Cloud Han 2013-06-12 11:42:04 UTC
Here I got this:

cloud@Cloud:test$ ./test
There are 15 devices 
Device 2 does not have synaptics property 
Device 3 does not have synaptics property 
Device 4 does not have synaptics property 
Device 5 does not have synaptics property 
Device 6 does not have synaptics property 
Device 7 does not have synaptics property 
Device 8 does not have synaptics property 
Device 9 does not have synaptics property 
Device 10 does not have synaptics property 
Device 11 does not have synaptics property 
Device 12 does not have synaptics property 
Device 13 does not have synaptics property 
Device 14 does not have synaptics property 
Device 15 has synaptics property 
Device 15 has enabled property 
Device 16 does not have synaptics property 
Found touchpad with deviceId 15 
Grab successful for  199 1 
Grab successful for  200 1 
Grab successful for  201 1 
X Error: BadAccess (attempt to access private resource denied) 10
  Major opcode: 33 (X_GrabKey)
  Resource id:  0x93
X Error: BadAccess (attempt to access private resource denied) 10
  Major opcode: 33 (X_GrabKey)
  Resource id:  0x93
X Error: BadAccess (attempt to access private resource denied) 10
  Major opcode: 33 (X_GrabKey)
  Resource id:  0x93
Comment 18 Albert Astals Cid 2013-06-12 18:45:05 UTC
Is that with the ktouchpadenabler kded module loaded or not loaded?
Comment 19 Cloud Han 2013-06-13 08:33:02 UTC
yes, ktouchpadenabler is loaded.

When unloaded, I only got this:
There are 15 devices 
Device 2 does not have synaptics property 
Device 3 does not have synaptics property 
Device 4 does not have synaptics property 
Device 5 does not have synaptics property 
Device 6 does not have synaptics property 
Device 7 does not have synaptics property 
Device 8 does not have synaptics property 
Device 9 does not have synaptics property 
Device 10 does not have synaptics property 
Device 11 does not have synaptics property 
Device 12 does not have synaptics property 
Device 13 does not have synaptics property 
Device 14 does not have synaptics property 
Device 15 does not have synaptics property 
Device 16 has synaptics property 
Device 16 has enabled property 
Found touchpad with deviceId 16 
Grab successful for  199 1 
Grab successful for  200 1 
Grab successful for  201 1
Comment 20 Albert Astals Cid 2013-06-15 17:15:14 UTC
Ok, giving you a new main.cpp, this one will say what is the touchpad status and if you press the keys should switch between enabling and disabling the touchpad, does this work? (Make sure you unload ktouchpadenabler)
Comment 21 Albert Astals Cid 2013-06-15 17:15:38 UTC
Created attachment 80537 [details]
New main.cpp file
Comment 22 V字龍(Vdragon) 2013-06-16 04:51:26 UTC
Hi, just come to say I have the nearly same issue.
I'd previously filed a bug report here:
https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/1190685

I'll do the same test when I got free time ;)
Comment 23 V字龍(Vdragon) 2013-06-16 04:56:25 UTC
The version I used is 4.10.4 from Kubuntu Backports PPA, and OS is Ubuntu 12.04LTS x86-32bit version on a ASUS A53S Laptop

In VERY RARE cases I can successfully toggle the touchpad, but mostly it just don't work :(

Should I disable Synaptiks daemon from autostart or should I keep it?
Comment 24 Cloud Han 2013-06-16 06:07:49 UTC
(In reply to comment #20)
> Ok, giving you a new main.cpp, this one will say what is the touchpad status
> and if you press the keys should switch between enabling and disabling the
> touchpad, does this work? (Make sure you unload ktouchpadenabler)

Touchpad is enabled 
Touchpad disabled 
Touchpad enabled

Successfully toggle touchpad status, works prefect, thanks.
Comment 25 Cloud Han 2013-06-16 06:13:03 UTC
(In reply to comment #23)
> The version I used is 4.10.4 from Kubuntu Backports PPA, and OS is Ubuntu
> 12.04LTS x86-32bit version on a ASUS A53S Laptop
> 
> In VERY RARE cases I can successfully toggle the touchpad, but mostly it
> just don't work :(
> 
> Should I disable Synaptiks daemon from autostart or should I keep it?

Download the two attachments and save to same directory.
unload ktouchpadenabler Module:
qdbus org.kde.kded /kded unloadModule ktouchpadenabler

compile the file:
qmake
make

run the binary:
./test

press the FN key and check if it toggle the status now
Comment 26 V字龍(Vdragon) 2013-06-16 06:25:57 UTC
(In reply to comment #25)
> (In reply to comment #23)
> > The version I used is 4.10.4 from Kubuntu Backports PPA, and OS is Ubuntu
> > 12.04LTS x86-32bit version on a ASUS A53S Laptop
> > 
> > In VERY RARE cases I can successfully toggle the touchpad, but mostly it
> > just don't work :(
> > 
> > Should I disable Synaptiks daemon from autostart or should I keep it?
> 
> Download the two attachments and save to same directory.
> unload ktouchpadenabler Module:
> qdbus org.kde.kded /kded unloadModule ktouchpadenabler
> 
> compile the file:
> qmake
> make
> 
> run the binary:
> ./test
> 
> press the FN key and check if it toggle the status now
Works as expected. :)  Thanks!
Comment 27 Albert Astals Cid 2013-06-16 11:06:36 UTC
Well, this is weird since this code is doing exatly what ktouchpadenabler is doing so i have no clue why this would work and ktouchpadenabler would not :-/

I'll leave this open and will try to think about the issue again and come back to you later.
Comment 28 rockonthemoonfm 2013-07-02 10:22:52 UTC
i had the same problem with a similar setup, Arch 4.10/4.11 beta 2.
ktouchpadenabler daemon was active and toggle-touchpad fn key was correctly mapped according to xev.
at first it worked, after it oddly stopped working. today I've found the issue , at least for my case: setting Numlock ON in keyboard kcm. If set to "OFF" or "leave unchanged" ktouchpad enabler works. 
so the bug is between keyboard KCM settings and ktouchpadenabler daemon.

so bug is at least CONFIRMED, hope that it will be marked as FIXED for 4.11 LTS release :)
Comment 29 Albert Astals Cid 2013-07-02 18:44:07 UTC
@josephk: Can you attach a screenshot of what you mean with "setting numlock on in keyboard kcm"?
Comment 30 rockonthemoonfm 2013-07-02 19:02:18 UTC
ok, after more testing i've found out that ktouchpadenabler doesn't work simply when num lk is active. (Keyboard kcm was just activating/deactivating NumLock). it works again after toggling Numlock off.
Comment 31 Albert Astals Cid 2013-07-03 22:19:05 UTC
@josephk: That is an interesting find indeed, are you able to compile the example as explained in comment 25? 

Does that also only work when numlock is disabled? Or works all the time?
Comment 32 rockonthemoonfm 2013-07-04 12:15:22 UTC
ok, patch here works. 
if numlk is disabled, touchpad toggle behaves correctly, notifications, no console output.
if numlk is enabled, touchpad toggle behaves correctly, no notifications, following output:

[alex@hobo x]$ ./test
There are 12 devices 
Device 2 does not have synaptics property 
Device 3 does not have synaptics property 
Device 4 does not have synaptics property 
Device 5 does not have synaptics property 
Device 8 does not have synaptics property 
Device 6 does not have synaptics property 
Device 10 does not have synaptics property 
Device 7 does not have synaptics property 
Device 9 does not have synaptics property 
Device 11 does not have synaptics property 
Device 12 does not have synaptics property 
Device 13 has synaptics property 
Device 13 has enabled property 
Found touchpad with deviceId 13 
Grab successful for  199 1 
Grab successful for  200 1 
Grab successful for  201 1 
X Error: BadAccess (attempt to access private resource denied) 10
  Major opcode: 33 (X_GrabKey)
  Resource id:  0x91
X Error: BadAccess (attempt to access private resource denied) 10
  Major opcode: 33 (X_GrabKey)
  Resource id:  0x91
X Error: BadAccess (attempt to access private resource denied) 10
  Major opcode: 33 (X_GrabKey)
  Resource id:  0x91
Touchpad is disabled 
Touchpad enabled 
Touchpad disabled 
Touchpad enabled 
Touchpad disabled
Comment 33 V字龍(Vdragon) 2013-07-04 12:30:49 UTC
@Albert Astals Cid 
I got the same result with @josephk, ktouchpadenabler only works when Numlock is not toggled, however the example here works in whatever cases.
Comment 34 Albert Astals Cid 2013-07-04 19:54:21 UTC
Ok, thanks.

Sadly i don't have a numlock key on my laptop so it's not easy for me to reproduce, i'll have a look to see what can be going on wrong.
Comment 35 Cloud Han 2013-07-09 17:23:53 UTC
As far as I know, laptops smaller than 15.6' which come without number pad should also have NumLock key bounded with a Fn key, maybe you can try it :)  or you can use an external USB keyboard with NumLock
Comment 36 Albert Astals Cid 2013-07-19 22:32:14 UTC
I could try this in a friends laptop this week and can confirm that indeed setting NumLock upsets ktouchpadenabler, unfortunately did not have time to debug it further. Will try to get an external USB keyboard and see if that also causes the problem.
Comment 37 Albert Astals Cid 2013-07-31 23:11:54 UTC
Git commit 60b423452be26e0d8c1408e7471f50cf09af28bc by Albert Astals Cid.
Committed on 31/07/2013 at 23:09.
Pushed by aacid into branch 'KDE/4.11'.

Grab the enable/disable/toggle Touchpad keys with any modifier

This way it still works even if you have numlock enabled
FIXED-IN: 4.11.0

M  +1    -1    ktouchpadenabler/ktouchpadenabler_daemon.cpp

http://commits.kde.org/kde-workspace/60b423452be26e0d8c1408e7471f50cf09af28bc
Comment 38 Christoph Feck 2013-08-11 14:46:00 UTC
Let's hope that nobody tries to assign Shift+Touchpad keys for other functions ;)