Mouse pointer moves to centre of canvas on click in OpenGL3 with Swing
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先使用 JME 3.7.0-stable、嵌入 Swing 的 OpenGL3 canvas,以及一个 InputManager.addListener(ActionListener) 处理程序复现该问题。比较 mouseDown 和 mouseUp 期间的 InputManager.getCursorPosition(),然后对照 OpenGL2 的行为调查 OpenGL3 Swing canvas 的输入路径。完成的标准是光标保持在其物理位置,并且两个事件都在不使用 Robot workaround 的情况下报告预期坐标。
由索引模型根据 Issue 内容生成。
描述
With JME3.7 we can now embed OpenGL3 canvas in a Swing window. I have noticed an issue with the mouse with this configuration.
Steps to reproduce:
- Use JME 3.7.0-stable
- Be running OpenGL3
- Have a jme canvas embedded in a swing window
- Listen for jme mouse events using InputManager.addListener(ActionListener)
- Left click on the canvas
- In the ActionListener, get the position of the mouse using InputManager.getCursorPosition()
Observed
The mouseDown (i.e. keyPressed=true) will have the correct mouse position.
By the time the mouseUp event is processed (i.e. keyPressed=false), the position of the mouse has been moved to the centre of the canvas.
- The mouse is physically displayed in the centre of the canvas
- InputManager.getCursorPosition() will return a mouse position in the centre of the canvas
Notes:
- This does not happen if you are not using Swing
- This does not happen in OpenGL2 with Swing
- Seen on both Windows 10 and current Debian linux stable (12.7)
A workaround (more a hack) is to
- Store the location of the mousedown event
- In the mouseup event, use java.awt.Robot to move the mouse back to where the mousedown event happened.
- 主要语言
- Java
- 星标
- 4.3k
- 派生
- 1.2k
- 平均合并
- 10 小时 15 分钟
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jMonkeyEngine/jmonkeyengine 的其他 Issue
-
Documentation
难度 2/5 1-3 小时 新手友好度 68/100
jMonkeyEngine/jmonkeyengine#2928 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
jMonkeyEngine/jmonkeyengine#2919 · 1 条评论 ·
维护者通常 1 天内回复
-
defect
难度 1/5 1 小时以内 新手友好度 88/100
jMonkeyEngine/jmonkeyengine#2717 ·
维护者通常 1 天内回复
-
Documentation
难度 3/5 1-2 天 新手友好度 55/100
jMonkeyEngine/jmonkeyengine#2931 · 1 条评论 ·
维护者通常 1 天内回复
-
Documentation
难度 3/5 1-2 天 新手友好度 57/100
jMonkeyEngine/jmonkeyengine#2930 · 3 条评论 ·
维护者通常 1 天内回复
查看 jMonkeyEngine/jmonkeyengine 的全部 Issue
相似的 Issue
-
pdfium-drift
难度 1/5 1 小时以内 新手友好度 82/100
Stirling-Tools/JPDFium#176 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
hiero-ledger/hiero-consensus-node#27712 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 61/100
Vakore/ZappierGames#162 ·
-
Improve README documentation clarity and fix minor wording issues可能已有人在做 @simplesilence 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 84/100
resilience4j/resilience4j#2567 ·
维护者通常 6 天内回复
-
Priority/High
难度 2/5 1-3 小时 新手友好度 65/100
wso2/dpdp-accelerator#417 ·
维护者通常 1 天内回复