boten Active Member Licensed User Longtime User Jan 2, 2016 #1 Is there a way to programatically change the keyboard direction, thus simulating alt+tab? I have some text fields that need input in Hebrew and i want to change the kb language in code when the field gets focus. It was possible in VB.
Is there a way to programatically change the keyboard direction, thus simulating alt+tab? I have some text fields that need input in Hebrew and i want to change the kb language in code when the field gets focus. It was possible in VB.
R Roycefer Well-Known Member Licensed User Longtime User Jan 2, 2016 #2 The jAWTRobot library will allow you to programmatically invoke system key-pressed and mouse-pressed events. If your desired effect can be effected by a key-combo, then it can be effected in code by this library. Upvote 0
The jAWTRobot library will allow you to programmatically invoke system key-pressed and mouse-pressed events. If your desired effect can be effected by a key-combo, then it can be effected in code by this library.
boten Active Member Licensed User Longtime User Jan 3, 2016 #3 My bad... I meant alt+shift Code: Copy RobotSpecialKeyPress("alt") RobotSpecialKeyPress("shift") did it. Thx Last edited: Jan 3, 2016 Upvote 0
My bad... I meant alt+shift Code: Copy RobotSpecialKeyPress("alt") RobotSpecialKeyPress("shift") did it. Thx
R Roycefer Well-Known Member Licensed User Longtime User Jan 3, 2016 #4 Don't forget to release those keys after pressing them. You'll probably also want a brief (maybe 10 millisecond) delay between pressing and releasing. Upvote 0
Don't forget to release those keys after pressing them. You'll probably also want a brief (maybe 10 millisecond) delay between pressing and releasing.
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2016 #5 You can easily implement a short delay with CallSubPlus: CallSubPlus - CallSub with explicit delay Upvote 0
boten Active Member Licensed User Longtime User Jan 3, 2016 #6 Erel said: You can easily implement a short delay with CallSubPlus: CallSubPlus - CallSub with explicit delay Click to expand... No need for any delay. alt+shift switches to Hebrew immediately Code: Copy Sub txtShem_FocusChanged (HasFocus As Boolean) Dim wr As AWTRobot wr.RobotSpecialKeyPress("alt") wr.RobotSpecialKeyPress("shift") wr.RobotSpecialKeyRelease("alt") wr.RobotSpecialKeyRelease("shift") End Sub works just fine. Switches to Hebrew when field got focus, switches back to English when lost focus Upvote 0
Erel said: You can easily implement a short delay with CallSubPlus: CallSubPlus - CallSub with explicit delay Click to expand... No need for any delay. alt+shift switches to Hebrew immediately Code: Copy Sub txtShem_FocusChanged (HasFocus As Boolean) Dim wr As AWTRobot wr.RobotSpecialKeyPress("alt") wr.RobotSpecialKeyPress("shift") wr.RobotSpecialKeyRelease("alt") wr.RobotSpecialKeyRelease("shift") End Sub works just fine. Switches to Hebrew when field got focus, switches back to English when lost focus
R Roycefer Well-Known Member Licensed User Longtime User Jan 3, 2016 #7 You might find that this code won't work on other systems as some systems require a key or mouse button to be held down longer than a minimum required time in order to be registered. If you run into this issue, you can use ws.RobotDelay(10). Upvote 0
You might find that this code won't work on other systems as some systems require a key or mouse button to be held down longer than a minimum required time in order to be registered. If you run into this issue, you can use ws.RobotDelay(10).