<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>351198</bug_id>
          
          <creation_ts>2015-08-11 19:53:24 +0000</creation_ts>
          <short_desc>&apos;Numlock&apos; is not trigger-able</short_desc>
          <delta_ts>2016-08-30 17:11:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kglobalaccel</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>350816</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Emil Sedgh">emilsedgh</reporter>
          <assigned_to name="Martin Flöser">mgraesslin</assigned_to>
          <cc>kdelibs-bugs-null</cc>
    
    <cc>thomas.luebking</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      <flag name="corner_case"
          id="1108"
          type_id="24"
          status="+"
          setter="thomas.luebking"
    />

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1536348</commentid>
    <comment_count>0</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-11 19:53:24 +0000</bug_when>
    <thetext>On KDE SC 4.x I used to have &apos;Numlock&apos; as a global shortcut to activate &apos;Present Windows&apos; desktop effect and it worked just fine.

On KF5/Plasma shell, I can save the Numlock as the shortcut for an action but pressing the button does not trigger the action.

Notes:
1) I first thought it could be a problem with present windows effect, but I tried Numlock for different shortcuts and no action is triggered by numlock.

2) I also thought that &apos;one-key&apos; shortcuts might have a problem. But I have &apos;F12&apos; as another global shortcut and it works fine.

3) None of the combinations of Numlock work (ef Ctrl+Numlock)

Reproducible: Always

Steps to Reproduce:
Open &apos;Global shortcut settings&apos;.
Choose an action (Like &apos;Activate Present windows on all desktops&apos;)
Define shortcut for it as &apos;Numlock&apos;
Apply the changes
Press &apos;Numlock&apos;.


Actual Results:  
Nothing happens

Expected Results:  
I expect the &apos;Present windows&apos; to be triggered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536351</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-11 20:03:40 +0000</bug_when>
    <thetext>I assume it works with no shortcut (whether for kwin, plasmashell, krunner, ...)?

Stunningly, it works here (numlock is actually a modifier on the X11 level, like meta or alt)
I assme the problem is a keyboard layout change after kglobalaccel was started.

Try to
   pkill kglobalaccel5; sleep 2; kglobalaccel5 &amp;

and whether the numlock shortcut suddenly works afterwards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536354</commentid>
    <comment_count>2</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-11 20:14:54 +0000</bug_when>
    <thetext>Oh well, I&apos;m using Caps-Lock as an additional &apos;Numlock&apos;.
But I assumed that works fine because on &apos;Set shorctur&apos; dialog when I press the Caps Lock button, it catches &apos;NumLock&apos;.

So steps to reproduce:

1) Go to system settings -&gt; Input devices -&gt; Keyboard -&gt; Advances tab
2) Under the menu &apos;Caps lock key behavior&apos; check the &apos;Mark Caps Lock an additional Num Lock&apos;
3) Open &apos;Global shortcut settings&apos;.
4) Choose an action (Like &apos;Activate Present windows on all desktops&apos;)
5) Click to define a custom shortcut
6) Press &apos;Caps lock&apos; (you can see that buttons shows &apos;Numlock&apos;)
7) Apply the changes
8) Press &apos;Numlock&apos;

(And no, restarting kglobalaccel didn&apos;t help)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536355</commentid>
    <comment_count>3</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-11 20:20:07 +0000</bug_when>
    <thetext>To clarify, you assign SW &quot;numlock&quot; by pressing HW &quot;caps lock&quot; and then the shortcut fails on the HW &quot;numlock&quot; key?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536358</commentid>
    <comment_count>4</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-11 20:28:55 +0000</bug_when>
    <thetext>Oh I&apos;m sorry Thomas, no.
Step 8 must be &apos;Press Caps Lock&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536369</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-11 21:49:46 +0000</bug_when>
    <thetext>What happens here is that only one of the keys (caps_lock XOR numlock)
a) acts as numlock (toggling the state)
b) triggers the shortcut
despite both generate a Num_Lock keysym.

It seems to be always the same and -actually- rather caps lock (ie. numlock being dead, but that might depend on the hardware layout or some caching)

How did that act on KDE4? Could you use both keys to toggle the keypad state?
Can you use _one_ of the keys to trigger the shortcut?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536371</commentid>
    <comment_count>6</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-11 22:00:58 +0000</bug_when>
    <thetext>I don&apos;t have an actual Numlock key on my keyboard
(Rather Syslock+Scroll Lock acts as NumLock).

But on KDE4, I could&apos;ve used Capselock-as-Numlock alone (with no combination).

I also could&apos;ve used Caps Lock alone.

Im also on #kwin if you need me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536378</commentid>
    <comment_count>7</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-11 22:53:22 +0000</bug_when>
    <thetext>I would assume that&apos;s because xcb_key_symbols_get_keycode returns a list of keycodes, but kglobalaccel only interprets the first one. I could assume unlike Xlib, where XKeysymToKeycode returns only one value, the keycodes are handled distinct in xcb.

Martin, recall https://git.reviewboard.kde.org/r/122454/#review75534 ;-)

dev note:
the returned array is nullptr or terminated by XCB_NO_SYMBOL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536421</commentid>
    <comment_count>8</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-12 09:53:14 +0000</bug_when>
    <thetext>https://git.reviewboard.kde.org/r/124710/

Notice that you can map caps_lock to other stuff (notably using xmodmap allows for pretty much everything in a rather simple manor)
Freaking around with numlock is generally error prone since you toggle the modifier as well and the modifier combo *does* matter on X11.

While th major toolkits will likely cover that, other handcrafted code may fail to handle certain keyboard input correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536454</commentid>
    <comment_count>9</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-12 13:35:22 +0000</bug_when>
    <thetext>I applied the patch and tested it,
but it doesn&apos;t seem to fix the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536473</commentid>
    <comment_count>10</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-12 14:33:36 +0000</bug_when>
    <thetext>That would seem to be a problem.

However, there&apos;s a trap on installation.
Plugins by default get installed to /usr/lib/plugins/org.kde.kglobalaccel5.platforms but most distro installation have a plugin path of /usr/lib/qt/plugins/org.kde.kglobalaccel5.platforms

=&gt; check whether the updated plugin is loaded (watch make install and compare &quot;strace kglobalaccel5 2&gt;&amp;1 | grep  KF5GlobalAccelPrivateXcb.so&quot;)

Since you however luckily can build patches, we can easily add some debug code to see what&apos;s failing otherwise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536480</commentid>
    <comment_count>11</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-12 14:48:37 +0000</bug_when>
    <thetext>I have KF5/Plasma built from sources using kdesrc-build, so there&apos;s no system-wide KDE installed.
So I&apos;m sure this is the used plugin.

However, something funny just happened.
I saw you last comment and found out that there&apos;s now a &apos;kglobalaccel5&apos; binary.

`killall kglobalaccel5`
`kglobalaccel5`

Voila. The caps:num now works as expected :)

I tried a few times. Started Plasma, it was broken. Then I killed kglobalaccel5 and started it manually and caps:num works.

That&apos;s with your patch applied. I will now try to undo your patch and see if it still behaves the same when killed and started manually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536482</commentid>
    <comment_count>12</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-12 14:53:22 +0000</bug_when>
    <thetext>I removed your patch and tried again.
Even without your patch, killing kglobalaccel5 and starting it again fixes the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536488</commentid>
    <comment_count>13</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-12 15:14:07 +0000</bug_when>
    <thetext>Errheeemmm... I&apos;ll refer to comment #1, push out my chest and say:

    &quot;I told you!&quot;

(Silence, I need that ;-)

Did you fetch kglobalaccel from git (master) or a stable tarball - for the recent commits seem to have patches for keymap change updates?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1536492</commentid>
    <comment_count>14</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-08-12 15:25:05 +0000</bug_when>
    <thetext>Oh you indeed told me and I promise I tried that. Weird.
Sorry about that man.

Its from git. Last commit:     &quot;Upgrade KF5 version to 5.14.0.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1538181</commentid>
    <comment_count>15</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-08-20 08:20:11 +0000</bug_when>
    <thetext>No problem. Just helps telling myself that I&apos;m a genius ;-)

So this is rather &quot;just&quot; a defect in catching re-map events then.

*** This bug has been marked as a duplicate of bug 350816 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1548214</commentid>
    <comment_count>16</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-10-05 21:36:15 +0000</bug_when>
    <thetext>Git commit bf71e536bd14e954c44da4ed7af43ef4ee711953 by Thomas Lübking.
Committed on 05/10/2015 at 21:19.
Pushed by luebking into branch &apos;master&apos;.

Grab all keys for a symbol

Otherwise, if a symbol is represented
by more than one key, only one key
will be an operative shortcut (though
they&apos;re both the same symbol)
REVIEW: 124710

M  +63   -58   src/runtime/plugins/xcb/kglobalaccel_x11.cpp

http://commits.kde.org/kglobalaccel/bf71e536bd14e954c44da4ed7af43ef4ee711953</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1548227</commentid>
    <comment_count>17</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2015-10-05 23:01:46 +0000</bug_when>
    <thetext>Just wanted to thank you, Thomas :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1548259</commentid>
    <comment_count>18</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-10-06 07:42:39 +0000</bug_when>
    <thetext>The actual bug (kbd map updates not caught) is not fixed, the patch only improves the situation for multiple mappings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1617961</commentid>
    <comment_count>19</comment_count>
    <who name="Emil Sedgh">emilsedgh</who>
    <bug_when>2016-08-30 17:11:52 +0000</bug_when>
    <thetext>*** Bug 367953 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>