Faking keypresses on Mac OS X

Thomas McGrath III 3mcgrath at comcast.net
Wed Feb 27 23:34:56 EST 2008


There is also the other system event codes:

Processes Suite  -  Terms and Events for controlling Processes
	click v : cause the target process to behave as if the UI element  
were clicked
		click [UI element] : The UI element to be clicked.
			[at list] : when sent to a "process" object, the { x, y } location  
at which to click, in global coordinates
			→ UI element
	key code v : cause the target process to behave as if key codes were  
entered
		key code integer : The key code(s) to be sent. May be a list.
			[using command down/control down/option down/shift down] :  
modifiers with which the key codes are to be entered
	keystroke v : cause the target process to behave as if keystrokes  
were entered
		keystroke text : The keystrokes to be sent.
			[using command down/control down/option down/shift down] :  
modifiers with which the keystrokes are to be entered

HTH

Tom


On Feb 27, 2008, at 2:45 PM, Jim Sims wrote:

>
> On Feb 27, 2008, at 8:34 PM, Trevor DeVore wrote:
>>
>> 8 is the C Key. 9 is the V key which I think is what you are after  
>> (you are using virtual key codes, right?).
>>
>> Regards,
>>
>> -- 
>> Trevor DeVore
>
> Yup  :-/
>
>
> If field "z" contains this (could also use a Custom Property):
>
> tell application "System Events"
> 		key code 9 using command down
> 	end tell
>
>
> Then fake button for letter "A" is this:
>
> on mouseUp
> set the clipboardData["text"] to "A"
> do fld "z" as Applescript
> end mouseUp
>
>
> sims
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ClipaSearch Pro
> http://www.ClipaTools.com
>
> Across Platforms - Code and Culture
> http://www.ezpzapps.com/blog/
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list