Lisp HUG Maillist Archive

Keyboard interaction with LIST-PANEL

Hi!

In a standard CAPI:LIST-PANEL like this one (from the CAPI Reference
Manual)

  (capi:contain
   (make-instance 'capi:list-panel
      :items '(:red :blue :green)
      :selected-item :blue
      :print-function
      'string-capitalize))

I can select items by pressing the key that corresponds to their first
character, i.e. if I press the "g" key it selects the "Green" item.

I notice this works on Windows but not with Linux/Motif.  Also, if I
inspect the list panel I see that it's embedded in a simple pinboard
layout but the input model of this layout is NIL.  (There's an
internal CAPI::EVENT-HANDLERS slot but it seems unrelated.)

So, am I right to assume that I can't "hook" into this keyboard
interaction because it's a feature provided by the underlying Win32
widget?  I was hoping that I could somehow trap some keystrokes and
trigger certain events.

Thanks,
Edi.

PS: Note to LispWorks: In the Linux/Motif version of the example above
    the "Red" item isn't shown initially, i.e. the panel is scrolled
    so that the selected item is the first one which is displayed.
    This is a bit unfortunate because it's a waste of space - the
    widget is big enough to show all three items.


Re: Keyboard interaction with LIST-PANEL

On Thu, 14 Jul 2005 10:56:44 +0200, Edi Weitz <edi@agharta.de> wrote:

> Also, if I inspect the list panel I see that it's embedded in a
> simple pinboard layout but the input model of this layout is NIL.

That was a thinko - the pinboard layout is most likely created by the
CONTAIN function.


Re: Keyboard interaction with LIST-PANEL

Hello Edi,

| Hi!
|
| In a standard CAPI:LIST-PANEL like this one (from the CAPI Reference
| Manual)
|
|   (capi:contain
|    (make-instance 'capi:list-panel
|       :items '(:red :blue :green)
|       :selected-item :blue
|       :print-function
|       'string-capitalize))
|
| I can select items by pressing the key that corresponds to their first
| character, i.e. if I press the "g" key it selects the "Green" item.
|
| I notice this works on Windows but not with Linux/Motif.  Also, if I
| inspect the list panel I see that it's embedded in a simple pinboard
| layout but the input model of this layout is NIL.  (There's an
| internal CAPI::EVENT-HANDLERS slot but it seems unrelated.)
|
| So, am I right to assume that I can't "hook" into this keyboard
| interaction because it's a feature provided by the underlying Win32
| widget?  I was hoping that I could somehow trap some keystrokes and
| trigger certain events.

You are unlikely to be able to hook. Moreover, pressing the key
corresponding the first letter does not work for a non-base Unicode
character on LWW.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Updated at: 2020-12-10 08:51 UTC