[Gambas-user] SendKeys for gambas2 ?
Benoit Minisini
gambas at ...1...
Fri Jul 13 11:26:43 CEST 2007
On vendredi 13 juillet 2007, Laurent Carlier wrote:
> On Friday 13 July 2007 03:52:50 Rob wrote:
> > On Thursday 12 July 2007, José Luis Redrejo wrote:
> > > It's possible. A present for you: this small c program send "Caps
> > > Lock" when it is on to assure that caps lock is not active. I don't
> >
> > I forgot all about the XTest extension. It would be pretty easy to
> > wrap that in a Gambas component (though I'm not sure about mapping
> > whatever keycodes Gambas uses to X keycodes, if they're different)
> > and if no one's done it by when I have coding time available,
> > probably early September, I'll do it myself.
> >
> > Do all X servers pretty much have the XTest extension turned on by
> > default? Mandriva has theirs turned on and it looks like Ubuntu does
> > too, but I don't know whether it's standard enough to make
> > a "gb.sendkeys" component.
> >
> > Rob
>
> There is some functions to translate key string to keysym :
> http://tronche.com/gui/x/xlib/utilities/keyboard/XStringToKeysym.html
>
> A good to way to add this should be through Application.SendKey() :-)
>
> Last word is for Benoit ;-p
>
> Regards,
1) I suggest Desktop.SendKey(s). This is the class for desktop related things.
2) You must test that the XTEST extension is available. There is a X API for
that, but I don't remember which one.
3) No need for a new component. You can put the code in gb.qt. I will put it
in gb.gtk too. In the future, maybe all desktop related things should be put
in gb.desktop - At the moment it is written in Gambas, so this is just a
matter of creating a C component and put the Gambas part in it.
Regards,
--
Benoit Minisini
More information about the User
mailing list