[Gambas-user] Form_keyPress

Benoit Minisini gambas at ...1...
Tue May 24 17:18:39 CEST 2005


On Tuesday 24 May 2005 08:27, Matthias Laur wrote:
> Hi,
>
> I want to make some hotkeys for a projekt. So I try to code it with
>
>
>
> Public sub Form_KeyPress ()
>
> If key.code = ... then
>
> Something happens
>
>
>
> But it works only if the form has no buttons and other controls. If the
> form has other controls, one of the controls has the focus and it don't
> works. Is there another way to make some hotkeys for a project?
>
>
>
> Regards,
>
> Matthias

There is no interface in the QT component to globally intercept key events 
yet, but there is a trick:

If you have a menu in your form, its keyboard shortcuts are globally managed. 
So you can add an hidden menu to your form to solve your problem.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list