Welcome to the AutoKey community, kh1nav3!
You can't get there from here (at least not directly).
First, the keyboard module (along with the rest of our API calls) is already exposed to AutoKey scripts. IIUC, importing it explicitly does nothing because Python sees it. It doesn't hurt anything though.
What I think you want for the first script is
keyboard.send_keys("1")
with a hotkey set (in the GUI) to Ctrl+1.
The second script should be triggered by 1
mouse.click_relative(0, 0, 1)
The only problem with this is that you have to press and hold the Ctrl key *before* pressing the 1 key to have the first script triggered instead of the second one.
Generally, it's not a good idea to trigger AutoKey actions with single keypresses because it makes that key unavailable for normal use. You can get around this to some extent by using AutoKey window filters so that only specific windows are affected.
If you have a broken keyboard that can't easily be replaced or an accessibility issue and you need to remap your keyboard, the xmodmap and xkb do that. I don't think they let you map a key to a mouse action though. For that, the bind command lets you map a hotkey to a command such as running a script.
Joe
but even after I deleted this last script, the first didn't work. What I'm doing wrong? --
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/2fc981e6-cfd7-41c0-b92f-5103705d4d93n%40googlegroups.com.