Page 1 of 1

Windows Key Support - Keystroke?

Posted: Mon Jan 08, 2007 9:16 pm
by Vego
Hi Oleg, is there a way to send the windows key as a keystroke? I.e. windows key + D to minimize all windows?Thanks,Sam

Windows Key Support - Keystroke?

Posted: Tue Jan 16, 2007 8:34 am
by Vego
Sorry to bump my question, how would I go about doing this Oleg?Thanks,Sam

Windows Key Support - Keystroke?

Posted: Wed Jan 17, 2007 4:18 am
by mikronos
Hi Sam.Actually I think that Robotask can't intercept the windows key.But there is way ( I use it !! ) to do that with a little part of basic programming.This is the basic code used for this:Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Sub Main    ' simul pressing key   keybd_event 91, 0, 0, 0 'win    keybd_event 68, 0, 0, 0 'D      Sleep (5)    ' now release key    keybd_event 68, 0, 2, 0 'D    keybd_event 91, 0, 2, 0 'win    Sleep(5)End SubThis little piece of code generate the appropriate event. Note that if you want to simul another key you just have to change the ascii code of this example. Here the number 68 is the ascii letter for 'D'I join the entire code here ( use import for use it in robotask ), I'm sure that what you want!!cheer, -Mikronos.;**********************;* RoboTask Task file *;* Do not edit!       *;********************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|0ContinueOnError=INTEGER|0ExternalName=STRING|"Simul_WIN_D"Hide=INTEGER|0ID=INTEGER|1620541461Name=STRING|"Simul_WIN_D"Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3[Actions]Action1=FOLDER[Actions\Action1]ActionID=STRING|"BASIC_SCRIPT"Enabled=INTEGER|-1Name=STRING|"Basic Script"Params=FOLDER[Actions\Action1\Params]line00001=STRING|"Declare Sub keybd_event Lib ""user32"" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)"line00003=STRING|"Declare Sub Sleep Lib ""kernel32"" (ByVal dwMilliseconds As Long)"line00006=STRING|"Sub Main"line00008=STRING|"    ' simul pressing key"line00009=STRING|"   keybd_event 91, 0, 0, 0 'win"line00010=STRING|"    keybd_event 68, 0, 0, 0 'D"line00011=STRING|"    Sleep (5)"line00013=STRING|"    ' now release the key"line00014=STRING|"    keybd_event 68, 0, 2, 0 'D"line00015=STRING|"    keybd_event 91, 0, 2, 0 'win"line00016=STRING|"    Sleep(5)"line00018=STRING|"End Sub"linecount=STRING|"19"source=STRING|"0"

Windows Key Support - Keystroke?

Posted: Wed Jan 17, 2007 5:28 am
by Oleg
Great!
"Send keystrokes" is in need of improvement and doesn't support Win-key now.

Windows Key Support - Keystroke?

Posted: Sun Jan 28, 2007 1:49 pm
by Vego
That's great! Thank you Mikronos!Send keystrokes is one of the easier ways to automate basic work flow (for us not as programming centric folk) since I can watch the script working with the program after executing. Robotask has already saved me over 5 hours of work!~Sam