简体   繁体   English

X11 KeySyms:切换模式,KeySym组和XK_ISO_Level3_Shift

[英]X11 KeySyms: Switch mode, KeySym groups and XK_ISO_Level3_Shift

I'm using Xlib for a project, and I'm trying to get the KeySym relative to a pressed key. 我正在将Xlib用于一个项目,并且正在尝试使KeySym相对于按下的键。

I've got the KeyCode relative to the pressed key, keyboard modifiers and keyboard indicators. 我已经获得了与按下的键,键盘修饰符和键盘指示器相关的KeyCode。 I'm referring to this page to understand how to retrieve the correct key, but it must be out of date or something, because my X doesn't behave like that page says. 我指的是该页面,以了解如何检索正确的密钥,但是它必须是过时的或类似的东西,因为我的X的行为不如该页面所说。

I've got some questions: 我有一些问题:

  1. What is MODE SWITCH? 什么是模式开关? How can I see what key is my MODE SWITCH and how can I set it? 如何查看“模式开关”是什么键,如何设置? (via Xlib functions or via a command, it's the same). (通过Xlib函数或通过命令,是相同的)。

  2. That page says that the first 4 KeySyms associated to a KeyCode (found with XGetKeyboardMapping , or shown by xmodmap -pk command) are divided into two groups. 该页面说,与KeyCode关联的前4个KeySyms(通过XGetKeyboardMapping找到,或通过xmodmap -pk命令显示)被分为两组。 MODE SWITCH switches between groups, and within a group the first or the second KeySym is chosen according to modifiers (ie, shift key) or indicators (ie, caps lock). MODE SWITCH在组之间切换,并且在组内根据修饰符(即Shift键)或指示器(即大写锁定)选择第一个或第二个KeySym。 But on my XI can see that if shift is pressed, I switch to the third KeySym, not the second one. 但是在我的XI上可以看到,如果按下shift键,则切换到第三个KeySym,而不是第二个。

  3. On many european layouts AltGr key is bound to KeySym XS_ISO_Level3_Shift , which doesn't belong to any keyboard modifier (ie, shift , lock , control , mod1 , mod2 , mod3 , mod4 and mod5 ). 在许多欧洲布局中,AltGr键绑定到KeySym XS_ISO_Level3_Shift ,该键不属于任何键盘修饰符(即shiftlockcontrolmod1mod2mod3mod4mod5 )。 When such XS_ISO_Level3_Shift is pressed, the fifth KeySym associated to the KeyCode is chosen. 当按下此类XS_ISO_Level3_Shift ,将选择与KeyCode关联的第五个KeySym。 Why? 为什么? Where can I found some info about this XS_ISO_Level3_Shift and about other keysyms that are actually used, but not documented on Xlib manuals? 在哪里可以找到有关此XS_ISO_Level3_Shift以及一些实际使用但未在Xlib手册中记录的其他按键符号的信息?

It looks like the page you're reading predates Xkb - I'd guess that content is 10-15 years old at least. 看来您正在阅读的网页早于Xkb-我猜内容至少有10-15年的历史。

See: http://www.xfree86.org/current/XKBproto.pdf 参见: http : //www.xfree86.org/current/XKBproto.pdf

"xmodmap -pm" will show you the modifier keys such as mode switch. “ xmodmap -pm”将向您显示修改键,例如模式切换。

With Xkb, the behavior of basically everything is configurable, I believe. 我相信,使用Xkb,基本上所有东西的行为都是可配置的。 Start looking at /usr/share/X11/xkb/ for example. 例如,开始查看/ usr / share / X11 / xkb /。 I don't know a lot about it but hopefully looking at Xkb instead of old docs will get you pointed in the right direction. 我对此了解不多,但是希望查看Xkb而不是旧文档会为您指明正确的方向。

Tronche's manual is incomplete. Tronche的手册不完整。 I found more info about keyboard functions in: 我在以下位置找到了有关键盘功能的更多信息:
1. xlib.pdf 1. xlib.pdf
2. xlib html manual at static.cray-cyber.org . 2. static.cray-cyber.org上的xlib html手册 This doc is hidden and a bit broken. 该文档是隐藏的,有点破损。 Links are typed in lowercase, but the actual documents are in uppercase. 链接以小写字母键入,但实际文档以大写字母键入。 After correcting the urls in browser it's readable. 在浏览器中更正网址后,它是可读的。

PDF is complete I guess. 我猜PDF是完整的。 I don't know if [2] is complete too, but for example the chapter 16.2 (sorry, I can't give a link cause my link limit is exceeded) is far longer than in Tronche's doc. 我也不知道[2]是否也完整,但是例如16.2章(抱歉,由于超出了我的链接限制,我不能给出链接)比Tronche的文档中的要长得多。

I'm a beginner in understanding xlib, that's what I managed to google out today. 我是了解xlib的初学者,这就是我今天设法用Google搜索出来的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM