Lisp HUG Maillist Archive

Raw keyboard input

Hi,

I wonder if it is possible to capture the ”raw” keyboard input to an output-pane. Using the :gesture-spec or :key parameters to the :input-model I can’t distinguish between e.g. the numerical keyboard and the ”normal” digits 0-9 – they appear identical to the handler function. 

Obviously at some level the virtual keycode from the underlying OS must be present, but it seems it is mangled before it reaches the CAPI handlers. Is there any way to retrieve the keycode from a keyboard event?

Thanks

Erik





_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Raw keyboard input

Anyone?

Digging deeper into the actual behaviour of our software among various customers has revealed quite different behaviours on different systems and keyboards. It seems impossible to address these issues without more information from the CAPI on the actual keyboard events…

Erik



> 24 sep. 2020 kl. 21:33 skrev Erik Ronström <erik.ronstrom@doremir.com>:
> 
> Hi,
> 
> I wonder if it is possible to capture the ”raw” keyboard input to an output-pane. Using the :gesture-spec or :key parameters to the :input-model I can’t distinguish between e.g. the numerical keyboard and the ”normal” digits 0-9 – they appear identical to the handler function. 
> 
> Obviously at some level the virtual keycode from the underlying OS must be present, but it seems it is mangled before it reaches the CAPI handlers. Is there any way to retrieve the keycode from a keyboard event?
> 
> Thanks
> 
> Erik
> 
> 
> 
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Raw keyboard input

Since an output-pane is really an editor pane, I wonder if you could solve your issue using editor key bindings (e.g. see editor:bind-key). It has been a long time, but I seem to recall it could address specific keyboard gestures rather than the returned character.

John DeSoi, Ph.D.


 

> On Sep 30, 2020, at 7:57 AM, Erik Ronström <erik.ronstrom@doremir.com> wrote:
> 
> Anyone?
> 
> Digging deeper into the actual behaviour of our software among various customers has revealed quite different behaviours on different systems and keyboards. It seems impossible to address these issues without more information from the CAPI on the actual keyboard events…
> 
> Erik
> 
> 
> 
>> 24 sep. 2020 kl. 21:33 skrev Erik Ronström <erik.ronstrom@doremir.com>:
>> 
>> Hi,
>> 
>> I wonder if it is possible to capture the ”raw” keyboard input to an output-pane. Using the :gesture-spec or :key parameters to the :input-model I can’t distinguish between e.g. the numerical keyboard and the ”normal” digits 0-9 – they appear identical to the handler function. 
>> 
>> Obviously at some level the virtual keycode from the underlying OS must be present, but it seems it is mangled before it reaches the CAPI handlers. Is there any way to retrieve the keycode from a keyboard event?
>> 
>> Thanks
>> 
>> Erik
>> 
>> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Raw keyboard input


> On Sep 30, 2020, at 10:19 AM, Erik Ronström <erik.ronstrom@doremir.com> wrote:
> 
> Well I can indeed address specific keyboard gestures (even with :input-model), but the problem is that e.g. numeric keyboard digits and ”normal” digit characters seem to look the same to CAPI. Please correct me if I’m wrong! Actually, I haven’t been able to find any documentation of what keys/keyboard gestures actually exist in CAPI. If you know of one, please let me know!


Look at system:make-gesture-spec. I see some keypad items, but nothing separate for numbers. You might have to use the FLI to get what you need.


John DeSoi, Ph.D.


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Raw keyboard input

> Look at system:make-gesture-spec. 


Wow, it is actually documented! Thanks! I have managed to not find that page for almost 10 years now!  :D

> I see some keypad items, but nothing separate for numbers.

You are right: what I need just isn’t there.

> You might have to use the FLI to get what you need.

I’d love to, if I could just find a way to get hold of the keyboard event that CAPI processes…

(While it would probably be possible to install some kind of app-global key tap, I suspect that would be messy as the same events would be processed twice (once by the key tap and once by CAPI) and I’d have to keep it in sync somehow)


The Best Way (IMO) would be that CAPI provided more fine-grained information in its keyboard events. But that is obviously outside my control. (hint hint…)




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Scaling a button image

Hi! Does anyone know whether it’s possible in CAPI to display a button with a button image scaled by 50%?

I’m already successfully loading images into a capi:output-pane and displaying them scaled by 50% using:

(gp:draw-image pane image x y :from-x (* 2 x) :from-y (* 2 y)
                              :from-width (* 2 width) :from-height (* 2 height)
                              :to-width width :to-height height)

However I can’t find a way to do it with button images. What I’m doing is creating a capi:push-button and then doing something like:

(setf (capi:button-image button) "mybutton.gif")

Thanks!
David

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

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