AutoHotKey as a rebinding tool.

71 views
Skip to first unread message

Vitalie Spinu

unread,
Aug 16, 2011, 5:18:25 AM8/16/11
to autoke...@googlegroups.com
Hi Chris and Others,

I just discovered the AutoKey. It's amazing, this is the only
software which is able to rebind the key combinations properly.
Thanks Chris, it's the best.

A couple of notes:

1. I would like to rebind C-n and C-p to send <down> and <up>
globally. As an emacs user, these shortcuts are just stuck in my head.

It works properly almost everywhere, except for the drop-down menus in
firefox and opera. I mean those menus which popup at address bar or
search bars when you start typing something.
In case of those menus it look like the application grabs the key
before the autokey does. Any ideas?


2. For emacs users out there. Have anyone attempted implementing the
basic emacs editing and window management commands in autokey?

Particularly capitalization, transient mark (C-space activates the
shift), transposing lines, killing line, switching to other window
etc.

Obviously one would need composite shortcuts for the full power (like
"C-x 2" for splinting window horizontally). Autokey is not supporting
them yet, but would definitely be an unique feature.


3. In line with simplification discussion on the mailing list. You can
implement any phrase as just 'keyboard.send_keys("blabla")', right? So
why would one need phrases?

Also Chris, I perfectly agree that you should spend your valuable time
and knowledge on developing the internals of autokey and not the GUIs.
And if there is anyone interested on developing the GUI let him do it
as separate application.

The way I see the configuration file is plain python with functions to
construct the hierarchy of keys and scripts. It looks like almost
everything is already there in the engine class.

Many thanks,
Vitalie.

Evan Edwards

unread,
Aug 16, 2011, 10:41:12 AM8/16/11
to autoke...@googlegroups.com
On Tue, Aug 16, 2011 at 4:18 AM, Vitalie Spinu <spin...@gmail.com> wrote:
> Obviously one would need composite shortcuts for the full power (like
> "C-x 2" for splinting window horizontally).  Autokey is not supporting
> them yet, but would definitely be an unique feature.

I had suggested it at one point, but went off on a trip with
limited net access right afterwards and didn't really follow up when
Chris asked for more information. I'm glad to see somebody else
mentioning it.

In combination with a good window manager, it would be an
impressively powerful desktop setup.

--
Evan Edwards
ev...@cheshirehall.net
814.889.8845

Johnny Rosenberg

unread,
Aug 16, 2011, 10:59:29 AM8/16/11
to autoke...@googlegroups.com
2011/8/16 Evan Edwards <ev...@cheshirehall.net>:

I think it's possible to do this without AutoKey, by editing some
EvDev files. I created my own keyboard layout that way, but I didn't
change any Ctrl sequences, on the other hand, but I think it's
possible.

As a first hint, the files are located in:
/usr/share/X11/xkb/

Symbols are defined in the symbols folder
(/usr/share/X11/xkb/symbols). There are a lot of files for different
languages and countries. You can edit them or create new ones.
If you make new ones or create new layouts by adding layouts to the
existing file, you also need to edit two files in the rules folder
(/usr/share/X11/xkb/ruiles):
evdev.lst
evdev.xml

Take a look in them and you'll hopefully realise how they work, but
you won't need them if you only edit the symbols of an existing
layout. Don't forget to make backups of the original files in case
your do something bad…


Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ

Evan Edwards

unread,
Aug 16, 2011, 11:15:29 AM8/16/11
to autoke...@googlegroups.com
On Tue, Aug 16, 2011 at 9:59 AM, Johnny Rosenberg
<gurus....@gmail.com> wrote:
> I think it's possible to do this without AutoKey, by editing some
> EvDev files. I created my own keyboard layout that way,

EvDev isn't application context sensitive, and it also cannot
trigger code (AFAIK - it's been awhile since I poked at it). I
believe that, while you can remap, you can not do things that autokey
can do -- like fire off DBUS calls, launch apps, execute snippets of
code, or have exceptions to the map based on which application has
focus.

You could work around it with a program... but by that point,
you're rewriting AK.

--
Evan Edwards
ev...@one.vi
814.889.8845

Johnny Rosenberg

unread,
Aug 16, 2011, 12:03:35 PM8/16/11
to autoke...@googlegroups.com
2011/8/16 Evan Edwards <ev...@one.vi>:

> On Tue, Aug 16, 2011 at 9:59 AM, Johnny Rosenberg
> <gurus....@gmail.com> wrote:
>> I think it's possible to do this without AutoKey, by editing some
>> EvDev files. I created my own keyboard layout that way,
>
>   EvDev isn't application context sensitive, and it also cannot
> trigger code (AFAIK - it's been awhile since I poked at it).  I
> believe that, while you can remap, you can not do things that autokey
> can do -- like fire off DBUS calls, launch apps, execute snippets of
> code, or have exceptions to the map based on which application has
> focus.

Well, I didn't say you should replace AutoKey with some EvDev hacking,
I do both.
But as I said, I'm not sure you can remap Ctrl sequences.

If I understood you correctly, the OP wanted to remap Ctrl+n to Page
Down and Ctrl+p to Page Up since Emacs works like that, but as far as
I remember, Emacs also accepts Page Up and Page Down, so remapping
them permanently wouldn't do that much of harm, but on the other hand,
Ctrl+n means New Window in some application, so maybe it wasn't such a
good idea after all…


Regards

Johnny Rosenberg
ジョニー・ローゼンバーグ

Chris D

unread,
Aug 16, 2011, 5:56:37 PM8/16/11
to autokey-users
Hi Vitalie,

On Aug 16, 7:18 pm, Vitalie Spinu <spinu...@gmail.com> wrote:
> Hi Chris and Others,
>
> I just discovered the AutoKey. It's  amazing, this is the only
> software which is able to rebind the key combinations properly.
> Thanks Chris, it's the best.

Glad you think so :)

> A couple of notes:
>
> 1. I would like to rebind C-n and C-p to send <down> and <up>
> globally. As an emacs user, these shortcuts are just stuck in my head.
>
> It works properly almost everywhere, except for the drop-down menus in
> firefox and opera. I mean those menus which popup at address bar or
> search bars when you start typing something.
> In case of those menus it look like the application grabs the key
> before the autokey does. Any ideas?

The grabbing of keys doesn't always seem to work very consistently, it
appears because the creation of some windows does not generate a
Mapped event which is how AutoKey detects these. This is definitely an
AutoKey bug but one that I'm not really sure how to resolve at this
point.

> 2. For emacs users out there. Have anyone attempted implementing the
> basic emacs editing and window management commands in autokey?
>
> Particularly capitalization, transient mark (C-space activates the
> shift), transposing lines, killing line, switching to other window
> etc.
>
> Obviously one would need composite shortcuts for the full power (like
> "C-x 2" for splinting window horizontally).  Autokey is not supporting
> them yet, but would definitely be an unique feature.

This is definitely something that I would consider implementing in the
future especially if I go ahead with the rewrite.

> 3. In line with simplification discussion on the mailing list. You can
> implement any phrase as just 'keyboard.send_keys("blabla")', right? So
> why would one need phrases?

That is correct, but phrases had some extra features (although most of
these are now gone). They are more of a legacy thing than anything
else.

> Also Chris, I perfectly agree that you should spend your valuable time
> and knowledge on developing the internals of autokey and not the GUIs.
>  And if there is anyone interested on developing the GUI let him do it
> as separate application.
>
> The way I see the configuration file is plain python with functions to
> construct the hierarchy of keys and scripts. It looks like almost
> everything is already there in the engine class.

This is more or less the way I'm heading, although it will still be
trying to make it easier for the user and more similar to the way
AutoHotKey works (although not implementing the same syntax).

> Many thanks,
> Vitalie.

Vitalie Spinu

unread,
Aug 17, 2011, 5:10:10 AM8/17/11
to autoke...@googlegroups.com
>> 2. For emacs users out there. Have anyone attempted implementing the
>> basic emacs editing and window management commands in autokey?
>>
>> Particularly capitalization, transient mark (C-space activates the
>> shift), transposing lines, killing line, switching to other window
>> etc.
>>
>> Obviously one would need composite shortcuts for the full power (like
>> "C-x 2" for splinting window horizontally).  Autokey is not supporting
>> them yet, but would definitely be an unique feature.
>
> This is definitely something that I would consider implementing in the
> future especially if I go ahead with the rewrite.
>

Would be great. I am thinking along the lines of stumpWM window
manager http://www.nongnu.org/stumpwm/manual/stumpwm_2.html#SEC7

Also discovered this post
http://askubuntu.com/questions/5017/way-to-automatically-resize-2-windows-to-take-up-half-of-the-screen/5026#5026
with a couple of nice window tiling/manipulation applications which
might be useful with autokey.

Reply all
Reply to author
Forward
0 new messages