I have a listctrl. ctrl-a selects all items, ctrl-c copies them to the clipboard (in the usual way).
I want to add a single button to my wxpython gui to do both operations but can find no information.
Can anyone help please?
I know how to build a button and a gui!
It's the ctrl-A and ctrl-C behaviour I want to mimic...
You will need to create a keyboard event, triggered by the keyboard scan code for ctrl-A
ctrl-C is special case, as it triggers system abort command, and that will have to be intercepted,
this doc discusses capturing a keystroke event:
https://wxpython.org/Phoenix/docs/html/wx.KeyEvent.html
Unfortunately, I have been unable after several tries to load wxpython on OpenSuse, and haven't got around to resolving the issue (hasn't been a priority, and won't be until I need GUI for something) so can't actually test any code.
There was a thread about intercepting ctrl-C recently, may or may not be this one:
https://python-forum.io/Thread-Generate-...-behaviour