May-11-2019, 04:07 AM
(May-10-2019, 09:55 PM)Yoriz Wrote: Hi
Your question is very vague
(May-10-2019, 09:31 PM)sgskge1 Wrote: Is there a way in python to simulate a keyboard command within the code.
Within what code ?
Quote:I created an Icon button for Undo. Each time I press the button with a mouse click, I want it to execute the Conrol + Z keyboard press which would represent the Undo command.
What did you use to create a button, where do you want it to execute the Control + Z keyboard
Thank you for your response, and my apologies for not being more specific in the original post.
I added items to an existing context menu using python code for a text editor. The items are Undo and Redo. Each time I select Undo from the context menu, I want it to execute the Undo command. That would be the equivalent of typing 'Control + Z' on the keyboard. My question is there a way to simulate 'Control + Z' command using python code. Right now, I've set it up to print "hello world" each time I select Undo from the context menu. Ultimately, I want it to execute the Undo edit command ('Control + Z') , each time I select Undo from the context menu.
s.