PrtScn 按钮的热键

Hotkey for the PrtScn button

我创建了一个屏幕截图插件,并试图为 "Print Screen" 按钮添加一个热键。

这是我用来创建热键的代码,它运行良好,即使 XGrabKey 返回 1 我认为这意味着失败,因为它是 "already grabbed".

但是有人知道 PrtScn 的常量吗?我似乎找不到 XK_??? 值。

我尝试了 XK_PrintXK_Sys_Req,但它们都不起作用。

谢谢

应该是XK_Print。我 运行 xev 和 Print Screen 给出了这个输出。

KeyRelease event, serial 41, synthetic NO, window 0x4a00001,
    root 0xbd, subw 0x0, time 3103925, (400,-192), root:(400,631),
    state 0x10, keycode 107 (keysym 0xff61, Print), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

/usr/include/X11/keysymdef.h包含以下内容

#define XK_Print                         0xff61

但请注意,我只有一个 KeyRelease 事件,所以至少在我的桌面上有一些东西(可能是用于屏幕截图的 KDE 钩子)在 xev 可以看到它之前吃掉了新闻事件。