I am a KDE user thinking about moving to Unity. Due to manual disability, I use sticky keys and in KDE I have an applet in the system panel which shows which modifier keys are active. I remember that Gnome had this feature as well, so do Windows and OS X.
How does one ad the keyboard modifier state applet to the panel in Unity?
Clarification: I have already enabled sticky keys. I am asking how to add an applet which indicates the state of the modifier keys. This indicator would show when the Shift key is depressed, when the Alt key is depressed, when the Tux key is depressed, and when the Ctrl key is depressed. This applet exists in all major desktop environments (KDE, Windows, Mac OSX, and Gnome). It is necessary for accessibility of the desktop.
Here is an image of the keyboard modifier state applet, next to the keyboard layout indicator applet. The modifiers represented are, from left to right, Shift
, Ctrl
, Alt
, I-dont-know-this-one
, Tux/Win
, NumLock
, and CapsLock
. It can be seen that the NumLock key is active.
Best Answer
This is an outstanding issue in Unity:
The code below has been updated, now it can use icons to show state. But it may get slow sometime as I has to update icon file on hard drive then reload it again. (See notes about this issue/limitation in
libappindicator
)A well packaged release was made available on webupd8 ppa (Thanks goes to Alin Andrei /Andrew/)
Reference: Keyboard Modifiers State indicator For Ubuntu: Xkbmod Indicator
Original Answer:
This is not attended to be a canonical answer to the question. It could be counted as a work around. Hopping someone writes sophisticated solution for it.
This a simple prototype keyboard modifiers indicator for Unity.
Image starting from left: Icon, Shift, Locked Caps, Ctrl, Alt, Super, Locked AltGr (Small circle to indicate locked state)
Source file
unity-xkbmod.c
:Installing needed headers/libs: (Not sure if I miss any)
Compiling:
Run:
Note:
libappindicator
used for Unity indicators lack an important feature which make easy to ports other desktops indicators. See Bug #812067 API needed: pixbuf icon setting supportWithout this feature, let's say we need (Shift, Ctrl, Alt, AltGr, Super) with sticky keys active; we have 3 main status for each (Off, On/Latched, Locked). So 3^5 combined icons should be generated. (Where normal case just 3x5 single icons)
That's why I used indicator label with symbols from DejaVu Sans font.
To put an icon, place it in same folder and name it
icon.*
. Accepted formats: png, svg, ico, xpm ...If you don't like any icon, just create a 1x1 px image instead.
References:
xkbwatch
&plasma-widget-kbstate