3

I'm trying to assign the key shift+end to alt+shift+pageDown.

I have the following script:

keyboard.send_key('<shift>+<end>')

And I tried several variants, like:

keyboard.send_key('<shift+end>')
keyboard.send_key('shift+end')
etc...

none of them seems to work.

I had a look at this docs: https://github.com/boppreh/keyboard#api and also this: https://pypi.org/project/keyboard/ but many of those methods just don't seem to work (keyboard.send, keyboard.press, keyboard.release, etc.). It looks like my hotkey installation is using a different version of the keyboard library.

Also tried with (from this question):

keyboard.press_key('<shift>')
keyboard.send_key('<end>')
keyboard.release_key('<shift>')

But they seem to miss the pressed shift, it's just like pressing the end key.

Is there some way I could find out with keyboard library I am using, so that I could find the corresponding documentation?

using autokey-gtk 0.95.1, autokey-common 0.95.1 on ubuntu 18.04.2

opensas
  • 60,462
  • 79
  • 252
  • 386
  • For others finding this: Don't use `keyboard.send_key()` unless you need its key repeat parameter. Generally, start with filling the clipboard and pasting. If that doesn't work (it won't do fancy non-text things like sending control characters), use `keyboard.send_keys()`. It's also almost always better to select the Paste using Clipboard (Ctrl+V) option for your phrases as well. – Joe Oct 11 '20 at 21:54

2 Answers2

6

I had to use the following

keyboard.send_keys("<shift>+<end>")
opensas
  • 60,462
  • 79
  • 252
  • 386
  • 1
    *This.* Everywhere else I was finding only overly complicated tips using the kind of sequence you mentioned in your question, discussing about whether a `time.sleep(0.1)` is needed between the multiple `keyboard.(press|send)_key` calls. The documentation sadly also doesn't make it clear. – kdb Nov 24 '21 at 08:15
0

Not sure if this is what you're looking for, but I think a text expansion macro with ++ as output and then you can click the hotkey "Set" button and then "Press to Set" button and hit "shift+End" and then hit ok and save for input. Based on the "special keys" page: https://github.com/autokey/autokey/wiki/Special-Keys