9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Special keys ...
@ 2006-01-28 12:01 Philippe Anel
  2006-01-28 14:12 ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Anel @ 2006-01-28 12:01 UTC (permalink / raw)
  To: 9fans

Hello,

    In vncv source, it seems that some control key events are forwarded
to the server (see /sys/src/cmd/vnc/kbdv.c):

----------------------
        switch(r){
        case Kalt:
            alt = !alt;
            keyevent(v, Xalt, alt);
            break;
        case Kctl:
            ctl = !ctl;
            keyevent(v, Xctl, ctl);
            break;
        case Kshift:
            shift = !shift;
            keyevent(v, Xshift, shift);
            break;
----------------------

However, looking at /sys/src/9/pc/kbd.c, those key events are not sent 
through /dev/cons.
(Moreover values assigned to those key differ from those in keyboard.h).

I think we can't send those key event through /dev/cons without many 
changes to programs.

Therefore I'd like to:
1) add a control messages to /dev/consctl (ctlkeyon/ctlkeyoff) in 
port/devcons.c
2) modify pc/kbd.c to send KshiftDown, KshiftUp, ... when ctlkeyon has 
been sent to /dev/consctl
3) modify rio to handle those control messages (and to redirect read 
control key events only to the
    right windows).

Do you think it is the right way to patch vncv ?

    Philippe,



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

* Re: [9fans] Special keys ...
  2006-01-28 12:01 [9fans] Special keys Philippe Anel
@ 2006-01-28 14:12 ` Russ Cox
  2006-01-28 15:01   ` Philippe Anel
  0 siblings, 1 reply; 4+ messages in thread
From: Russ Cox @ 2006-01-28 14:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Therefore I'd like to:
> 1) add a control messages to /dev/consctl (ctlkeyon/ctlkeyoff) in port/devcons.c
> 2) modify pc/kbd.c to send KshiftDown, KshiftUp, ...  when ctlkeyon has
> been sent to /dev/consctl
> 3) modify rio to handle those control messages (and to redirect read
> control key events only to the right windows).
> 
> Do you think it is the right way to patch vncv ?

No, it's not.

You can send those key events by typing Alt Z C, Alt Z S, and Alt Z A
(they are listed in /lib/keyboard) if you really need them.

Control and Shift are already handled properly when you type a control
or uppercase character, so the only time you really need them is to
type Alt or to do fancy mouse clicks with keyboard modifiers.

Plan 9 handles Alt for itself, so that you can type Unicode characters
into every program, not just ones that have been specially coded.

Russ


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

* Re: [9fans] Special keys ...
  2006-01-28 14:12 ` Russ Cox
@ 2006-01-28 15:01   ` Philippe Anel
  2006-01-28 15:33     ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Anel @ 2006-01-28 15:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Russ Cox a écrit :

>>Therefore I'd like to:
>>1) add a control messages to /dev/consctl (ctlkeyon/ctlkeyoff) in port/devcons.c
>>2) modify pc/kbd.c to send KshiftDown, KshiftUp, ...  when ctlkeyon has
>>been sent to /dev/consctl
>>3) modify rio to handle those control messages (and to redirect read
>>control key events only to the right windows).
>>
>>Do you think it is the right way to patch vncv ?
>>    
>>
>
>No, it's not.
>
>You can send those key events by typing Alt Z C, Alt Z S, and Alt Z A
>(they are listed in /lib/keyboard) if you really need them.
>
>Control and Shift are already handled properly when you type a control
>or uppercase character, so the only time you really need them is to
>type Alt or to do fancy mouse clicks with keyboard modifiers.
>
>  
>
I understand, but it doen't help.
I'd like to use the shift in combination with the arrow keys (for a vnc 
server running under windows)
to select some text.

    Philippe

>Plan 9 handles Alt for itself, so that you can type Unicode characters
>into every program, not just ones that have been specially coded.
>
>Russ
>
>
>  
>



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

* Re: [9fans] Special keys ...
  2006-01-28 15:01   ` Philippe Anel
@ 2006-01-28 15:33     ` Russ Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Russ Cox @ 2006-01-28 15:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I understand, but it doen't help.
> I'd like to use the shift in combination with the arrow keys (for a vnc
> server running under windows)
> to select some text.

Alt Z S arrows Alt Z S.  Or use the mouse.

Russ


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

end of thread, other threads:[~2006-01-28 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-28 12:01 [9fans] Special keys Philippe Anel
2006-01-28 14:12 ` Russ Cox
2006-01-28 15:01   ` Philippe Anel
2006-01-28 15:33     ` Russ Cox

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