alexpgp: (Computing)
alexpgp ([personal profile] alexpgp) wrote2013-04-16 10:03 pm

Learn and unlearn...

Yesterday, I noted that I was able to "fix" a number of AutoHotkey macros that no longer worked now that I was using the Unicode-compatible version of the program. The new code works, in Word, but not in other programs that don't grok Unicode, such as my implementation of emacs.

In other words, the change of AutoHotkey macro, from
:*c?:\ZH\::{ASC 0142}
to
:*c?:\div\::
Send {U+017D}
return
will not allow me to type a 'LATIN CAPITAL LETTER Z WITH CARON' (aka, 'Z HACEK') in just any old place (Word, check; Semagic, check; emacs, nope).

So, I tried a new method:
:*c?:\ZH\::
Send,{AltDown}{Numpad0}{Numpad1}{Numpad4}{Numpad2}{AltUp}
return
and it works well enough, but not in emacs (at least, not out of the box), because the macro mimics the physical act of pressing down the Alt key, then four numeric keys on the numeric keypad (as opposed to the numbers on the top row of the alphabet section), and finally releasing the Alt key, which theoretically should result in the appropriate letter showing up on the screen—except that pressing down the Alt key is generally a way of telling emacs that you're about to invoke a command.

The good news is that in my version of emacs, the combination of a depressed Alt key and a depressed numeric pad key is not defined, so "all I have to do" is figure out how to pass those keystrokes on to the operating system, and I'm jake.

More as I learn more...

[identity profile] alexpgp.livejournal.com 2013-04-25 04:54 pm (UTC)(link)
There's a germ for a good stand-up routine in there, somewhere.

Glad to hear from you!

Cheers...