1 /*************************************************************************
2 * based on xkeyboard.h by Leonid Zeitlin (lz@europe.com) *
3 * heavily modified by Ketmar // Vampire Avalon *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 *************************************************************************/
11 #ifndef JRUGRXKEYBOARD_H
12 #define JRUGRXKEYBOARD_H
14 #include "jrugrdefs.h"
23 typedef QList
<XkbLayoutInfo
> QXkbLayoutList
;
26 class XKeyboard
: public QObject
{
32 inline bool isXKBAvailable () { return mXKbAvailable
; } // is XKEYBOARD extension available in the X server?
34 int groupCount (); // return number of the currently configured keyboard groups
35 void groupNames (QStringList
&list
); // get the names of the currently configured keyboard groups
36 void symbolNames (QStringList
&list
); // get the 'short' names of the currently configured keyboard groups
38 void groupInfo (QXkbLayoutList
&list
);
40 void setActiveGroup (int groupno
); // set the current keyboard group to the given groupno
41 int activeGroup (); // return the current keyboard group index
43 void processEvent (XEvent
*ev
);
45 static int findBySym (const QXkbLayoutList
&lst
, const QString
&sym
);
48 void groupChanged (int groupno
); // signals that new keyboard group is selected
49 void layoutChanged (); // signals that keyboard layout has changed and thus we need to reconfigure