[PD] generatiing a keypress

Patrice Colet pat at mamalala.org
Tue May 20 16:00:48 CEST 2008


Hans-Christoph Steiner a écrit :
> On Dec 16, 2007, at 11:19 PM, Patrice Colet wrote:
>> Hans-Christoph Steiner a écrit :
>>>> PureData can do this on linux and now on windows with the help of
>>>> different externals.
>>>>   I bet many users would love to have a single external for both
>>>> platforms, that uses the same parameters, same help file, the object
>>>> would have then the same name, it wouldn't be x11key anymore but
>>>> [keystroke] or something like this and would work on most platforms.
>>>>   Aalex, what do you think?
>>> Sounds like a great idea.  How about something like [send_key] or 
>>> [type_key]?
>>> .hc
>> [send_key] sounds good, also I might have found how to do this on MAC 
>> OS    X, by the use of sysctl.h, with looking at the source of some 
>> programs that emulates keystrokes, but I haven't got the machine for 
>> testing...
> Post the example code and someone will probably look at it.  If it is 
> easy, I'll do it, especially if there is already a cross-platform object 
> written.
> Also, [hid] and [hidio] both have a cross-platform event/message scheme 
> that is translated into the native platform messages.  I think for 
> [send_key] it use an existing scheme, like from [key]/[keyup]/[keyname] 
> or [hidio].

  I'd like to make a proposition with this attached object in 
construction, it uses different fonctions that ease handling to a window 
with EnumWindow() and FindWindow() function.
  The user will only have to know the first characters of the window to 
handle, also a list of all visible windows can be printed into the console.
  We can send a character or a character chain, but puredata will drop 
some keycodes if it's sent through a message box.
  Now I need to find out how to do the same thing with X11, then it will 
be possible to have a single external with the same functions.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sendkey.zip
Type: application/octet-stream
Size: 8955 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080520/bc120e5e/attachment.obj>

More information about the Pd-list mailing list