I tried to implement two buttons with Undo Redo functionality to step backwards and forward in a textarea control.
As well as with the codearea library. By using jAWTRobot library v1.61 and setting focus to the control while performing
Works:
Undo works on my system (Windows 10 running on an Intel i7 CPU, but ctrl_y does not work in jAWTRobot library.
The default manual keys ctrl+z and ctrl+y works as it should in Windows 10. But my "hack" is not a preffered method.
That's why I am reaching out to get help with this, and perhaps Reflector library could be better for such tasks.
So to sum this up I want the users to be able to step back and forth between code using buttons that sets focus on the textarea and gets the job done.
Let me add that I have tried the solution below but that only highlighted where the cursor is from the default ctrl key on Windows 10.
Does not work:
Please confirm how this works on your system and hopefully this can be solved!
Regards,
Roger
As well as with the codearea library. By using jAWTRobot library v1.61 and setting focus to the control while performing
Works:
undoredo:
txtAreaDocs.RequestFocus
Main.AWTRobot.RobotSpecialKeyCombo("ctrl_z")
Undo works on my system (Windows 10 running on an Intel i7 CPU, but ctrl_y does not work in jAWTRobot library.
The default manual keys ctrl+z and ctrl+y works as it should in Windows 10. But my "hack" is not a preffered method.
That's why I am reaching out to get help with this, and perhaps Reflector library could be better for such tasks.
So to sum this up I want the users to be able to step back and forth between code using buttons that sets focus on the textarea and gets the job done.
Let me add that I have tried the solution below but that only highlighted where the cursor is from the default ctrl key on Windows 10.
Does not work:
hack:
txtAreaDocs.RequestFocus
Main.AWTRobot.RobotSpecialKeyCombo("ctrl_y")
robot:
txtAreaDocs.RequestFocus
Main.AWTRobot.RobotSpecialKeyPress("ctrl")
Main.AWTRobot.RobotSpecialKeyPress("z")
Main.AWTRobot.RobotSpecialKeyRelease("z")
Main.AWTRobot.RobotSpecialKeyPress("ctrl")
Please confirm how this works on your system and hopefully this can be solved!
Regards,
Roger
Last edited: