From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Mon, 7 Dec 2009 14:13:26 +0000 Message-ID: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> From: Lorenzo Bolla To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000e0cd29d84a55d54047a240f95 Subject: [9fans] keyboard events in sam Topicbox-Message-UUID: a9ff4592-ead5-11e9-9d60-3106f5b1d025 --000e0cd29d84a55d54047a240f95 Content-Type: text/plain; charset=ISO-8859-1 Hi all, looking at sam sources from plan9port, it seems that CTRL-0 and CTRL-p (and followings, like CTRL-1 and CTRL-q, CTRL-2 and CTRL-r, etc) corespond to the same hex value. Is there a way to discriminate between them? I haven't found a way to detect the press of the Alt key (or is it just used to compose utf chars)? Or, even better, can you point me to a more detailed document than man that explain how keyboard is handled? Thanks, L. --000e0cd29d84a55d54047a240f95 Content-Type: text/html; charset=ISO-8859-1 Hi all,
looking at sam sources from plan9port, it seems that CTRL-0 and CTRL-p (and followings, like CTRL-1 and CTRL-q, CTRL-2 and CTRL-r, etc) corespond to the same hex value.
Is there a way to discriminate between them?
I haven't found a way to detect the press of the Alt key (or is it just used to compose utf chars)?
Or, even better, can you point me to a more detailed document than man that explain how keyboard is handled?

Thanks,
L.
--000e0cd29d84a55d54047a240f95-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> References: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> Date: Mon, 7 Dec 2009 14:39:54 +0000 Message-ID: <80c99e790912070639l693ac40cr3fa763bf0b2f6350@mail.gmail.com> From: Lorenzo Bolla To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000e0cd1a90245f502047a246e29 Subject: Re: [9fans] keyboard events in sam Topicbox-Message-UUID: aa0e4574-ead5-11e9-9d60-3106f5b1d025 --000e0cd1a90245f502047a246e29 Content-Type: text/plain; charset=ISO-8859-1 To be more precise, I meant "samterm", not sam. Sorry for the noise. L. On Mon, Dec 7, 2009 at 2:13 PM, Lorenzo Bolla wrote: > Hi all, > looking at sam sources from plan9port, it seems that CTRL-0 and CTRL-p (and > followings, like CTRL-1 and CTRL-q, CTRL-2 and CTRL-r, etc) corespond to the > same hex value. > Is there a way to discriminate between them? > I haven't found a way to detect the press of the Alt key (or is it just > used to compose utf chars)? > Or, even better, can you point me to a more detailed document than man that > explain how keyboard is handled? > > Thanks, > L. > --000e0cd1a90245f502047a246e29 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable To be more precise, I meant "samterm", not sam.
Sorry for the = noise.
L.


On Mon, Dec 7, 2009 at 2= :13 PM, Lorenzo Bolla <lbolla@gmail.com> wrote:
Hi all,
lookin= g at sam sources from plan9port, it seems that CTRL-0 and CTRL-p (and follo= wings, like CTRL-1 and CTRL-q, CTRL-2 and CTRL-r, etc) corespond to the sam= e hex value.
Is there a way to discriminate between them?
I haven't found a way to detect the press of the Alt key (or is it just= used to compose utf chars)?
Or, even better, can you point me to a more= detailed document than man that explain how keyboard is handled?

Thanks,
L.

--000e0cd1a90245f502047a246e29-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> References: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> Date: Mon, 7 Dec 2009 08:17:33 -0800 Message-ID: Subject: Re: [9fans] keyboard events in sam From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Topicbox-Message-UUID: aa435174-ead5-11e9-9d60-3106f5b1d025 sam(1) says ``Text may be typed and edited as in rio(1); also the escape key (ESC) selects (sets dot to) text typed since the last mouse button hit.'' rio(1) has a subsection titled ``Text windows.'' Ctrl-0 isn't a real control sequence (if you look at the output of "ascii", the valid control characters are A through _). What byte are you trying to type? You cannot detect the press of the Alt key - the kernel does that as part of its keyboard handling. Russ From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> Date: Mon, 7 Dec 2009 16:49:17 +0000 Message-ID: <80c99e790912070849t55a06ccas45d49efcbdcbf5af@mail.gmail.com> From: Lorenzo Bolla To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000e0cd16e2efcde3c047a263c4c Subject: Re: [9fans] keyboard events in sam Topicbox-Message-UUID: abfe465e-ead5-11e9-9d60-3106f5b1d025 --000e0cd16e2efcde3c047a263c4c Content-Type: text/plain; charset=ISO-8859-1 On Mon, Dec 7, 2009 at 4:17 PM, Russ Cox wrote: > sam(1) says ``Text may be typed and edited as in rio(1); > also the escape key (ESC) selects (sets dot to) text typed > since the last mouse button hit.'' > > rio(1) has a subsection titled ``Text windows.'' > This subsection is in 9term(1) in plan9port. Thanks, I hadn't seen it! > > Ctrl-0 isn't a real control sequence (if you look at the output > of "ascii", the valid control characters are A through _). > What byte are you trying to type? > I'm trying to map some simple operations to control-sequences, like jumping to the command win, flipping between buffers, and so on. I guess I'll have to do with A.._ chars, avoiding the ones already taken (ctrl-a, ctrl-u, ctrl-w, etc) > > You cannot detect the press of the Alt key - the > kernel does that as part of its keyboard handling. > > Russ > > This is unfortunate. Thank you very much, L. --000e0cd16e2efcde3c047a263c4c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Dec 7, 2009 at 4:17 PM, Russ Cox= <rsc@swtch.com&g= t; wrote:
sam(1) says ``Text may be typed and edited as in rio(1);
also the escape key (ESC) selects (sets dot to) text typed
since the last mouse button hit.''

rio(1) has a subsection titled ``Text windows.''

This subsection is in 9term(1) in plan9port. Thanks, I hadn't se= en it!
=A0

You cannot detect the press of the Alt key - the
kernel does that as part of its keyboard handling.

Russ


This is unfortunate.

Thank you very mu= ch,
L.
--000e0cd16e2efcde3c047a263c4c-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <80c99e790912070613g1caffb63m7c09e0530f687a95@mail.gmail.com> Date: Mon, 7 Dec 2009 12:10:50 -0500 Message-ID: From: Eoghan Sherry To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] keyboard events in sam Topicbox-Message-UUID: ac1fe688-ead5-11e9-9d60-3106f5b1d025 The keyboard is handled in src/cmd/devdraw which could be considered the plan9port equivalent of the Plan 9 kernel (at least the keyboard, mouse, and graphics part). The X11 version of devdraw maps the X notion of a keyboard to the Plan 9 one in __xtoplan9kbd (src/cmd/devdraw/x11-itrans.c). In particular, this function contains, /* Do control mapping ourselves if translator doesn't */ if(e->xkey.state&ControlMask && k != Kalt) k &= 0x9f; So, for instance, Ctrl-[0Pp] all map to 0x10. Not sure what the convention should be, but that's where it's enforced. Eoghan