Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #90606 > unrolled thread

Redefining keys for Terminal app

Started bymoroney@world.std.spaamtrap.com (Michael Moroney)
First post2016-03-31 15:27 +0000
Last post2016-04-21 16:54 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.sys.mac.system


Contents

  Redefining keys for Terminal app moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-03-31 15:27 +0000
    Re: Redefining keys for Terminal app billy@MIX.COM - 2016-03-31 18:12 +0000
      Re: Redefining keys for Terminal app moroney@world.std.spaamtrap.com (Michael Moroney) - 2016-04-04 16:49 +0000
        Re: Redefining keys for Terminal app billy@MIX.COM - 2016-04-21 16:54 +0000

#90606 — Redefining keys for Terminal app

Frommoroney@world.std.spaamtrap.com (Michael Moroney)
Date2016-03-31 15:27 +0000
SubjectRedefining keys for Terminal app
Message-ID<ndjfk5$g0o$10@pcls7.std.com>
Is there a way to redefine the key row "clear = / *" on the aluminum
keypad when using the "Terminal" app (on El Capitan, Mac Mini) to send
escape sequences, or to plug a PC keyboard into it and have the keys
PF1-PF4 send escape sequences? (when I do that now, those keys seem to be
dead).

[toc] | [next] | [standalone]


#90611

Frombilly@MIX.COM
Date2016-03-31 18:12 +0000
Message-ID<ndjpb9$547$1@reader2.panix.com>
In reply to#90606
In comp.sys.mac.system Michael Moroney <moroney@world.std.spaamtrap.com> wrote:

> Is there a way to redefine the key row "clear = / *" on the aluminum
> keypad when using the "Terminal" app (on El Capitan, Mac Mini) to send
> escape sequences, or to plug a PC keyboard into it and have the keys
> PF1-PF4 send escape sequences? (when I do that now, those keys seem to
> be dead).

You could create a .term file containing the key bindings, but my
understanding is that while newer versions of OS X and Terminal will
read them, they will no longer write (create) one.  So, that makes
it a bit of work.  Especially because you'd have to hack your way
into discovering the pertinent key codes.  A short exceprt (NB the
<esc>s are actually 0x1B chars in this file, and if the keys shown
match what your machine is doing that would be a miracle) -

<key>F704</key>
<string><esc>OP</string>     ! PF1
<key>F705</key>
<string><esc>OQ</string>     ! PF2
<key>F706</key>
<string><esc>OR</string>     ! PF3
<key>F707</key>
<string><esc>OS</string>     ! PF4

A much easier way is to just use the best key remapping tool on
the planet (it's free, too) -

https://pqrs.org/osx/karabiner/index.html.en

Billy Y..
-- 
        sub     #'9+1   ,r0             ; convert ascii byte
	add     #9.+1   ,r0             ; to an integer
	bcc     20$                     ; not a number

[toc] | [prev] | [next] | [standalone]


#90715

Frommoroney@world.std.spaamtrap.com (Michael Moroney)
Date2016-04-04 16:49 +0000
Message-ID<ndu5ue$sr7$1@pcls7.std.com>
In reply to#90611
billy@MIX.COM writes:

>In comp.sys.mac.system Michael Moroney <moroney@world.std.spaamtrap.com> wrote:

>> Is there a way to redefine the key row "clear = / *" on the aluminum
>> keypad when using the "Terminal" app (on El Capitan, Mac Mini) to send
>> escape sequences, or to plug a PC keyboard into it and have the keys
>> PF1-PF4 send escape sequences? (when I do that now, those keys seem to
>> be dead).

>You could create a .term file containing the key bindings, but my
>understanding is that while newer versions of OS X and Terminal will
>read them, they will no longer write (create) one.  So, that makes
>it a bit of work.  Especially because you'd have to hack your way
>into discovering the pertinent key codes.  A short exceprt (NB the
><esc>s are actually 0x1B chars in this file, and if the keys shown
>match what your machine is doing that would be a miracle) -

><key>F704</key>
><string><esc>OP</string>     ! PF1
><key>F705</key>
><string><esc>OQ</string>     ! PF2
><key>F706</key>
><string><esc>OR</string>     ! PF3
><key>F707</key>
><string><esc>OS</string>     ! PF4

Thanks for that info.  Do you know the name and where to put it would be?
How to obtain the codes (F704-F707 in the example) from the keyboard?

>A much easier way is to just use the best key remapping tool on
>the planet (it's free, too) -

>https://pqrs.org/osx/karabiner/index.html.en

Thanks, I'll try this first.

[toc] | [prev] | [next] | [standalone]


#91002

Frombilly@MIX.COM
Date2016-04-21 16:54 +0000
Message-ID<nfb0k6$7cc$1@reader2.panix.com>
In reply to#90715
In comp.sys.mac.system Michael Moroney <moroney@world.std.spaamtrap.com> wrote,
quoting me:

> ><key>F704</key>
> ><string><esc>OP</string>     ! PF1
> ><key>F705</key>
> ><string><esc>OQ</string>     ! PF2
> ><key>F706</key>
> ><string><esc>OR</string>     ! PF3
> ><key>F707</key>
> ><string><esc>OS</string>     ! PF4
> 
> Thanks for that info.  Do you know the name and where to put it would be?
> How to obtain the codes (F704-F707 in the example) from the keyboard?

I did it by putting bells (control-G) in the strings, then trying various
key codes - run Terminal via the .term file, then press the keys and see if
you hear beeps.  I believe the terminal emulator can do up to eight distinct
bells.  I know it can do four, for sure, so you can test a few key codes on
each iteration via the number of bells for each.  Yea, this was a tedious
process.  If you're a heavy user of DEC's text editors, it is worth the
effort, tho.  Or, was, prior to Mr. PQRS's work.

You'll also have to put the keypad in the applicaion mode first, by typing
out a file containing <esc>= (just two chars) first, for the above to work.

Billy Y..
-- 
        sub     #'9+1   ,r0             ; convert ascii byte
	add     #9.+1   ,r0             ; to an integer
	bcc     20$                     ; not a number

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.mac.system


csiph-web