I want to "Select all" via a robot pressing the keys Control and A, but i dont want the keyboardListener to notice it as input. Is there another way to use "Select all" or a way to differentiate between the two input types?

Edit: I'm using the JNativeHook NativeKeyboardListener, not the normal one, thought I'd point that out, maybe it has some special abilities. :)

有帮助吗?

解决方案

You could just set the selected range on the appropriate control. No keyboard is needed for this, so it won't be handled by a keyboard listener.

其他提示

You can inject input but in order for it to be recognized by the application layer it needs to propagate up through the input stack and thus will be recognized by the keyboardlistener.

Perhaps there is another way to perform a select all programmatically without injecting keyboard input.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top