Re: [AD] More Unix patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 23 Jun 1999, Michael Bukin wrote:

> I'm not sure what functions to use.  X-server generates KeyPress and
> KeyRelease events with keycodes in the range [8,255].  In
> XwinAllegro keycodes were converted to the keyboard controller
> hardware format (sequence of scancodes) which was processed similar to
> DOS version (now this sequence can be processed with _handle_pckeys).
> I don't think that processing with functions from keyboard.c can be as
> simple as with _handle_pckeys function.  AFAICS, it will be necessary
> to calculate ASCII values and scancodes according to state of modifier
> keys.  But maybe I'm wrong here?
>
> -- 
> Michael Bukin
> 

In the BeOS version I opted to use a lookup table to convert the
BeOS format scancode (which is a position in a bit array) to
allegro scancode using a lookup table.  To get a UTF-8 character,
I am using the BeOS's keymap structure, which I can get with a call.

This way, the persons default keymap will work to generate characters
the way they expect in BeOS.  Is there a Unicode entry method for
XWindows?  If so, I recommend that you use the keymap native to the OS,
and use its helper functions to get a UTF-8 character.

The only problem I had was mapping modifier keys.  BeOS has 'command' and
'option', which are mapped to Alt and AltGr respectively (left and right
Alt for Americans).  I just mapped them both to ALT, but this is what
Allegro does anyway.  What I have not done i figured out how to map
KB_ACCENT* and KB_INALTSEQ*  

Shawn, could you explain how these work?  I think that BeOS uses something
called 'dead keys' to handle accenting characters, which is probably the
same thing as the allegro accent shifts.  To give allegro access to these,
I may need to set a KB_ACCENT shift flag when a person uses a dead key
combination.  But to emulate this, I will need to have an explanation, (or
read the fine documentation ^_^)

There is also a lot of other functionality in pckeys.c which I don't want
to duplicate, but may want to use.  It really depends on if BeOS already
has keymapping that does everything Allegro creates for DOS.  If I do need
to use anything, it might be nessecary to isolate the hardware specific
parts of pckeys.c so that keyboard drivers that don't read pc scancodes
directly can take advantage of it.

Another keyboard driver related question.  Right now, capslock, numlock,
and scroll-lock all stay down when you press them, and are only released
when you hit them again.  I am thinking that this behavior is in software,
not hardware, and should be disabled when the allegro keyboard driver is
installed.  Am I right, or do these key need to continue to lock when
pressed?

PrintScr/SysRq has a strange habit of creating a screen shot in my home
directory when I press it.   I hope I can disable this.

Pause is a really strange key, I'm not sure at all what its doing, but its
not like the other keys.  I think that when you press it, it doesn't send
a scan code, but when you then press another key, it acts as if it were
pressed at the same time.  It does this until you press it again.  Is it
supposed to do this?


--
         The Phoenix - President of The Artistic Intuition Company
    Caelius * Zen-X * Mirror Reflex * Runica * X-Domain * Infinite Realms
                          http://www.io.com/~fenix



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/