9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] keyboard events in sam
@ 2009-12-07 14:13 Lorenzo Bolla
  2009-12-07 14:39 ` Lorenzo Bolla
  2009-12-07 16:17 ` Russ Cox
  0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Bolla @ 2009-12-07 14:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 477 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] keyboard events in sam
  2009-12-07 14:13 [9fans] keyboard events in sam Lorenzo Bolla
@ 2009-12-07 14:39 ` Lorenzo Bolla
  2009-12-07 16:17 ` Russ Cox
  1 sibling, 0 replies; 5+ messages in thread
From: Lorenzo Bolla @ 2009-12-07 14:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

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,
> 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.
>

[-- Attachment #2: Type: text/html, Size: 932 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] keyboard events in sam
  2009-12-07 14:13 [9fans] keyboard events in sam Lorenzo Bolla
  2009-12-07 14:39 ` Lorenzo Bolla
@ 2009-12-07 16:17 ` Russ Cox
  2009-12-07 16:49   ` Lorenzo Bolla
  2009-12-07 17:10   ` Eoghan Sherry
  1 sibling, 2 replies; 5+ messages in thread
From: Russ Cox @ 2009-12-07 16:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] keyboard events in sam
  2009-12-07 16:17 ` Russ Cox
@ 2009-12-07 16:49   ` Lorenzo Bolla
  2009-12-07 17:10   ` Eoghan Sherry
  1 sibling, 0 replies; 5+ messages in thread
From: Lorenzo Bolla @ 2009-12-07 16:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

On Mon, Dec 7, 2009 at 4:17 PM, Russ Cox <rsc@swtch.com> 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.

[-- Attachment #2: Type: text/html, Size: 1624 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] keyboard events in sam
  2009-12-07 16:17 ` Russ Cox
  2009-12-07 16:49   ` Lorenzo Bolla
@ 2009-12-07 17:10   ` Eoghan Sherry
  1 sibling, 0 replies; 5+ messages in thread
From: Eoghan Sherry @ 2009-12-07 17:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-07 17:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-07 14:13 [9fans] keyboard events in sam Lorenzo Bolla
2009-12-07 14:39 ` Lorenzo Bolla
2009-12-07 16:17 ` Russ Cox
2009-12-07 16:49   ` Lorenzo Bolla
2009-12-07 17:10   ` Eoghan Sherry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).