mouse-buttons

Detect if any mouse button is being pressed, and if so, which one?

点点圈 提交于 2021-02-19 07:40:49
问题 Basically, I want to query if any mouse button is being pressed and if so, which one. The problem is that I don't use a (constantly focused) UI environment. It is meant to be able to run in the background while the OS is focused on another window. I just have a Swing GUI set up for easy controlling. How could I do this? (By the way, I am trying to query it inside of a loop, so setting up an event listener wouldn't be efficient.) 回答1: As mentioned by others you would need to use JNA in order

Detect if any mouse button is being pressed, and if so, which one?

南楼画角 提交于 2021-02-19 07:39:31
问题 Basically, I want to query if any mouse button is being pressed and if so, which one. The problem is that I don't use a (constantly focused) UI environment. It is meant to be able to run in the background while the OS is focused on another window. I just have a Swing GUI set up for easy controlling. How could I do this? (By the way, I am trying to query it inside of a loop, so setting up an event listener wouldn't be efficient.) 回答1: As mentioned by others you would need to use JNA in order

Reading Special MouseButtons

风流意气都作罢 提交于 2019-12-11 08:02:07
问题 I am interested in capturing input from the explorer mouse buttons (the special buttons on the side of mice normally used to go forward and back on web browsers). import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.stage.Stage; import javafx.scene.input.MouseButton; import static java.lang.System.*; public class MouseThing extends Application { @Override public void start(Stage stage) throws Exception { Pane pane = new Pane(); pane

Remap `fn` to left mouse button on OSX

强颜欢笑 提交于 2019-12-08 17:39:48
问题 I get bad tendinitis from clicking the mouse all day. In the past I used Karabiner to remap the fn key to simulate a left mouse button. However it doesn't work with Sierra. I tried to accomplish this in Cocoa, and it correctly performs mouse-down/up when I press and release fn . However it doesn't handle double-click / triple-click. Also when dragging, (e.g. dragging a window, or selecting some text) nothing happens visually until I key-up, whereupon it completes. How can I adapt my code to

LButton Hotkey seems to prevent Send, {LButton}

丶灬走出姿态 提交于 2019-12-08 04:26:58
问题 I'm at a loss here. As soon as I add the LButton hotkey, the Send, {LButton} doesn't seem to work, but they show up in recently executed lines. Env. Windows 7x64, Disabled Touchpad, AHK v1.1.31.01. I try to emulate the Wink application (from DebugMode) to capture screenshots for training purposes. For that reason, I want to capture a screenshot just before a mouse click. This looks easy, and I even vaguely remember doing similar mouse hotkeys in the past. However I can't get this to work.