B4J Question Simulate keypress+combos

ThRuST

Well-Known Member
Licensed User
Longtime User
Hi all, I found this native Java code how to simulate keypress which I want to convert to B4J, because I need a automatic keypress of CTRL+V keypress and I need a solution without the jAWTRobot library.

Any solution needs to support SDK v9.0.4


You can find the native Java code here
 

ThRuST

Well-Known Member
Licensed User
Longtime User
The pasting occurs when a menuitem is clicked in the floating menu.
I just load text from the SQLite database into a string variable and to paste it at the cursor position I use

B4X:
AWTRobot.RobotPaste(cm_data)

Perhaps it cannot be used this way, but it works on PC. On Mac it pastes the character "v".
That's why I want to try another way, because I really want my project to work on Mac just the same.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
try
B4X:
AWTRobot.RobotSpecialKeyCombo("meta_v") ' for mac
AWTRobot.RobotSpecialKeyCombo("ctrl_v") ' for windows
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
I assume the delay is needed in both methods. It would be great if Roycefer could update his jAWTRobot library to v1.56!!
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
How to call the native code snippet and make it run in B4J? I guess it's something similar to post #29?
 
Upvote 0
Top