Re: [code] [textadept] Binding Keypad Enter

From: Qwerky <mr.qwerky.att.gmail.com>
Date: Tue, 6 Aug 2019 15:42:28 -0600

On 2019-08-06 13:40, dmccunney wrote:
> On Tue, Aug 6, 2019 at 1:06 PM Qwerky <mr.qwerky.att.gmail.com> wrote:
>> Hi. I've been able to bind some of the keypad keys (plus, minus, 0), but when binding the Enter key on the keypad, it does not work, regardless of the function it is bound to. Is it a problem on this end, or a problem elsewhere? [I've commented out the 'print' statements in /core/keys.lua, but I see no output for any key, either in a message buffer, nor in the console?]
> As Mitchell says, I don't think you can do this in TextAdept.
>
> When you press a key on the PC keyboard, what is sent to the host is a
> scancode. The scancode indicates the *position* on the keyboard of
> the key that has been pressed. The OS maintains a table of values
> mapped to keys at the various positions. (This is what permits code
> page changes in Windows - an alternate map is used.) You can find a
> good map of scancodes here:
> http://www.philipstorr.id.au/pcbook/book3/scancode.htm
>
> GtK appears to use the OS map, not the scancode. Depending on what
> you would like the Keypad Enter key to do, you *might* be able to
> remap it at the OS level outside of TextAdept.
>
> See https://www.howtogeek.com/howto/windows-vista/map-any-key-to-any-key-on-windows-xp-vista/
> for info on a utility to do it.
>
> I have not used the Sharpkeys utility discussed in the article to try
> to remap Keypad Enter, but it may work for you.
>
>> qwerky
> ______
> Dennis

Hi Dennis,

Thanks for that interesting and helpful information!  I was intending to
use the keypad plus, minus, and enter keys (with modifiers) for 'Zoom
In', 'Zoom Out', and 'Reset Zoom' respectively.  I changed 'Reset Zoom'
to use keypad star/asterisk/multiply instead, and it works fine[1].

I don't think I'll bother with the Sharpkeys utility simply for this one
key, but I appreciate the link, as I may try it for other purposes when
I find time.  I have some utilities, for example WordWeb, a nifty
dictionary, which allows changing its hotkey only to limited
combinations; perhaps Sharpkeys might help with that, or if not, perhaps
AutoHotkey might help.

[1]  With the caveat that the menu shows the hotkey as 'Ctrl+*' rather
than 'Ctrl+KP*', as it did with the keypad enter key, even though
control plus the asterisk above the '8' key does not generate the
function, either with or without the shift key.  I've noticed a few
other quirks in the menu's displayed hotkeys as well, though all in all
things are working extremely well.

qwerky

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 06 Aug 2019 - 17:42:28 EDT

This archive was generated by hypermail 2.2.0 : Wed 07 Aug 2019 - 06:55:58 EDT