Bind keyboard shortcut to one key in AutoHotkey with delay - autohotkey

I am using the Japanese IME on Windows 10. TL;DR there is a shortcut to switch from alphanumeric (latin alphabet) to Japanese input. The combination is ALT+` [l or r alt + tilde key]. For it to work, both keys must be held down but the alt key must be pressed first. I am trying to bind this combination to one key.
I have been able to bind normal letter keys to a combination of other letters (e.g. a -> b + c) but I cannot get it to work with the keys I need, and especially not because there needs to be a delay between them. The code confuses me.

Related

Re-enable right-Ctrl when using Canadian Multilingual Standard keyboard for my AutoHotkey function?

I have an Autohotkey function that lets me switch between tabs with "Control + left/right" as well as closing tabs (Ctrl-down) and going into the search bar (Ctrl-up). It helps me save clicks and use the mouse less.
However, I use the Canadian Multilingual Standard keyboard to type accents (éèçà) in French for some of my classes and this keyboard DISABLES the right control key (the one right beside my keyboard buttons) which is the most convenient to use with my right hand only.
Here is a source documenting this: http://archives.miloush.net/michkap/archive/2013/04/08/10409187.html
Is there any way I can override this? I very rarely use the letter œ for because I can just use ALT + 0156 instead.
Here is the very simple code for my hotkey!
^Left::SendInput, ^{PGUP}
^Right::SendInput, ^{PGDN}
^Up::SendInput, !d
^Down::SendInput, ^w
Using SciTE4AutoHotkey tool, on my UK hardware keyboard right ctrl is detected as expected (RControl)
When I switch to French (Canada) Canadian Multilingual keyboard,
the right ctrl key is not found, also Virtual Key is different: DF
(SC means scan code and VK means virtual key)
so if you remap, it should solve the problem
~SC11D::RControl
After remapping: not found is replaced by RControl with each keypress.
Even if above remapping does not work for your case, it is a matter of finding which key corresponds to relevant scan code and then you can remap it.
Double click on your ahk script on the taskbar, and then
View > Key history and script info (Ctrl + K) by pressing key and refresh(F5) you can see respective keyboard scan codes.

Detect special characters keypresses in AutoHotkey

How can I detect a key combination such as AltGr and special characters (I want to detect AltGr + ì, I have an Italian keyboard layout). Looking up online I came across SC combinations, which would be SC236, so I tried
<^>!SC236::send ~
Hotkeys can be triggered by using the hexadecimal virtual key (VK) code of a key
<^>!vkDD::send ~
in the rare case where a key has no name or the standard code doesn't work.
The virtual key code of such a key can be determined by following the steps at Special Keys. (On step 6 note the value in the first column of the list (VK)).

How do read DrRacket keybindings (and in general)

I have never been able to understand keybinding syntax well (bc it's hard to google if you don't know the name of a symbol to begin with!).
In DrRacket, I see bindings like "c:g" or "esc;g" .. I have tried hitting those keys in order to no avail. I have tried hitting them simultaneously. Nothing seems to work.
What do they mean? And, in general, how does one go about understanding this syntax?
A generic shortcut:
<modifier-key-1>:<key-1>;<modifier-key-2>:<key-2>;...;<key-n>
means:
press both <modifier-key-1> and <key-1> (that is: start pressing the modifier key, and while it is pressed, press key-1, then release both),
then, immediately, perform the same operation for the remaining combinations of keys,
finally, press <key-n>
Where the standard modifier keys are:
c - the control key modifier
s - the shift key modifier
m - the meta key modifier (not present in many keyboards)
a - the alt key modifier (sometimes already used to insert special characters)
(actually there are other key modifiers in different keyboards).
So, c:x;c:g;s:t means the following combination: Control-X, followed by Control-g, followed by Shift T (this insert Σ, the greek uppercase letter sigma in DrRacket), while c:x;c:g;s means Control-X followed by Control-G followed by the key s (insert the greek letter ς). Finally, the combination m-c-right means press both the modifier keys Meta and Control with the right arrow key.
When the meta modifier key is not present, it is often replace by the ESC (escape) key. Since this is not a key modifier, but a regular key, in this case it must be pressed and released before the next character. In other words, esc:g means: press the ESC key, release it, then immediately press the regular G key. esc-c-right means: press ESC, release it, then press C-→.
Moreover, when the ALT key is already used by the operating system to insert special characters, like in Mac OS X, it can be used as regular modifier key in DrRacket by setting a special preference (in Preferences > Editing > General).
In DrRacket you can find the current keybinding with the menu item: Edit > Keybindings > Show Active Keybindings, and you can find the relevant documentation here.

Remapping keys only one time in AutoHotkey

I use a German keyboard layout and I'm trying to move some keys around.
There is one physical key on my keyboard that has: ß, Shift+ß="?" and AltGr+ß="\", (in the US-layout is the - and Shift+-/kbd>="_" key).
I wish to move "ß" to AltGr+s, AltGr+ß="\" to "\" and disable AltGr+ß.
I tried this:
<^>!\::Return
<^>!s::Send ß
ß::Send \
This effectibly disables AltGr+ß="\" and makes ß input "\", but when I press AltGr+s it also inputs "\".
What I'm doing wrong?
I solved the problem after further trying:
ß::\
<^>!s::Send ß
<^>!ß::Return

Making a capital letter with a shift modifier press and hold option with Keyboard Maestro

I have been using Autoit for years and I have just discovered Keyboard Maestro for Mac and it's AWESOME!
Here is my problem. I need to simulate pressing the SHIFT + 1 key. Here are the steps
Press and Hold the Shift Key
Push and Release the 1 Key
Release the Shift Key
Pretty simple but for some reason it is not working. I am testing it out with the letter "a" instead of 1 because if it worked then it would create the capital letter "A".
How can I get this to produce a capital letter A by using the Shift Modifier?
Here is a screenshot of my macro
In "Simulate Keystroke", just hold down Shift+1. It will put that in as the keystroke combo, not the ! symbol.
Shift-1 example