未生成 FocusIn/FocusOut [英] FocusIn/FocusOut not generated

查看:25
本文介绍了未生成 FocusIn/FocusOut的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以澄清 X11 服务器的默认焦点处理吗?我的理解是焦点跟随鼠标",如果我在不同的终端之间移动鼠标,我可以看到光标在每个窗口获得/失去焦点时发生变化.

Can someone please clarify the default focus handling of the X11 server? My understanding is that the focus 'follows the mouse' and sure enough if I move the mouse between separate terminals I can see the cursor changing as each window aquires/loses the focus.

但是当我运行两个 xev 窗口并在它们之间移动指针时,当指针从一个窗口移动到另一个窗口时,我看到了大量的 MotionNotify/EnterNotify/LeaveNotify - 但 FocusIn 和 FocusOut 无处可见.这是 xev 的怪事吗?为了生成这些事件,是否需要应用一些特殊的掩码或属性?

But when I run two xev windows and move the pointer between them, I see plenty of MotionNotify/EnterNotify/LeaveNotify as the pointer moves from one window to another - but FocusIn and FocusOut are nowhere to be seen. Is this an oddity in xev? Is there some special mask or property which needs to be applied in order for these events to be generated?

非常感谢,R.

虽然我不完全理解答案,但我很感谢 parkydr、minitech 和任何其他可能来过的人.

While I do not fully understand the answer(s), I am grateful to parkydr, minitech and any others who may have stopped by.

再次感谢,R.

推荐答案

有焦点是指当你按下一个键时接收键盘输入的窗口.

Having focus refers to the window which receives keyboard input when you press a key.

焦点处理取决于您的窗口管理器.最常见的模式是单击以聚焦,您的窗口管理器设置为该模式,只有在单击窗口时才能获得焦点.另一种选择是键盘焦点跟随鼠标,这正是您所期望的.

The focus handling depends on your window manager. The most common mode is click to focus, which your window manager is set to, where you only get focus when you click on the window. An alternative is that the keyboard focus follows the mouse, which is what you are expecting.

应该有一个设置可以在您的窗口管理器设置中更改此设置.

There should be a setting to change this in your window manager settings.

光标变化并不表示焦点,只是终端定义了不同的光标.

The cursor changing does not indicate focus, just that the terminal has defined a different cursor.

为了演示,打开一个终端和一个 xev 窗口.

To demonstrate, open a terminal and an xev window.

  • 点击 xev 窗口并按下一个键,您将看到按键事件.
  • 将鼠标移动到终端窗口,您将看到动作和离开事件
  • 按下一个键,您仍会看到来自 xev 的按键事件
  • 点击终端窗口,xev 会给出一个 focus out 事件
  • 按一个键,字符将显示在终端窗口中
  • 将鼠标移到 xev 窗口上并按下一个键,字符仍会出现在终端窗口中

这篇关于未生成 FocusIn/FocusOut的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆