1

I have been using a virtual keyboard that uses ctypes in Python 3.3 for a while, and I can't get it to do Ctrl-Shift-Home, among other triple-key expressions, like Ctrl-Alt-Delete. The expression Ctrl-Shift-Home selects the text starting at the cursor going back to the beginning of the text---which works when I press the expression manually, but I cannot get my code to do it.

My code is essentially the same as the code from this stackoverflow answer, and then to do the expression I could do something like

def Ctrl_Shift_Home():
    PressKey(0x11) # Ctrl
    PressKey(0x10) # Shift
    PressKey(0x24) # Home
    time.sleep(0.1)
    ReleaseKey(0x24)
    ReleaseKey(0x10)
    ReleaseKey(0x11)

But the above does not select any text. Is this an issue with the code itself, or an issue with triple-key expressions, or is selecting text just not allowed using keyboard events?

Any answers or alternatives would be appreciated! Thank you!

diligar
  • 413
  • 5
  • 11

0 Answers0