[PATCH] NumLock/CapsLock masks in Thai XIM

Theppitak Karoonboonyanan thep at linux.thai.net
Mon Jul 14 05:19:40 PDT 2008


On Thu, Dec 13, 2007 at 5:58 PM, Daniel Stone <daniel at fooishbar.org> wrote:
> On Thu, Dec 13, 2007 at 01:10:28PM +0700, Theppitak Karoonboonyanan wrote:
>> On Wed, Dec 12, 2007 at 10:42:00AM -0600, mcnichol at austin.ibm.com wrote:
>> > The patch assumes that NumLock is always mapped to Mod2.
>> > That may not be true on all systems.  I know AIX uses Mod5.
>>
>> Mod5 is mapped for AltGr on Linux. And it should also be passed to the XIM,
>> like NumLock. So, it should be OK to add Mod5Mask to the list as well.
>>
>> However, is this assumption reliable? In summary, the masks that should
>> be passed to the sequence checking routine are Shift, CapsLock, NumLock,
>> and AltGr. And the known mappings are:
>>
>> bin. Macro       Linux     AIX      Operation
>> ---- ----------- --------- -------- ---------
>> 0x01 ShiftMask   Shift     Shift    Pass
>> 0x02 LockMask    CapsLock  CapsLock Pass
>> 0x04 ControlMask Ctrl      Ctrl     Block
>> 0x08 Mod1Mask    Alt       Alt(?)   Block
>> 0x10 Mod2Mask    NumLock   ?        Pass(?)
>> 0x20 Mod3Mask    ?         ?        ?
>> 0x40 Mod4Mask    Win       ?        Block(?)
>> 0x80 Mod5Mask    AltGr     NumLock  Pass
>>
>> Or is there more reliable way to handle this?
>
> The only way to really do this properly is to run XkbGetVirtualMods,
> IIRC.

I haven't been successful with XkbGetVirtualMods so far.
It keeps returning BadAlloc status in my system.

So, I finally come up with XGetModifierMapping instead.

Regards,
-- 
Theppitak Karoonboonyanan
http://linux.thai.net/~thep/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 021_Thai_xim_num_caps.diff
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080714/eee46b43/attachment.bin>


More information about the xorg mailing list