FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

sending function keys (F1 F2 ...) with SendVirtualKeystroke

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
daffy
Junior Member


Joined: 14 Jan 2006
Posts: 36
Location: Erlangen, Germany

PostPosted: Sat Jan 14, 2006 5:51 pm    Post subject: sending function keys (F1 F2 ...) with SendVirtualKeystroke Reply with quote

Hello,
I am currently trying to write a script to control TVTool on Windows XP. To switch to TV I have set the Hotkey "SHIFT+F1" and to switch to monitor I have set the Hotkey "SHIFT+F2".

As far as I know it, the ASCII Code for the function keys is unusual. Its actually a sequence of two strokes namely 0x00 and 0x3b (0x3c) for F1 (F2). How can I realise this with the SendVirtualKeystroke-function?

I already tried to just send the keystrokes seperately, but it wont work:
SendVirtualKeystroke( 0x00, true, false, false, false )
SendVirtualKeystroke( 0x3b, true, false, false, false )

Has anyone got an idea?
Back to top
View user's profile Send private message
daffy
Junior Member


Joined: 14 Jan 2006
Posts: 36
Location: Erlangen, Germany

PostPosted: Sat Jan 14, 2006 6:18 pm    Post subject: Reply with quote

Found the solution after a small search in this forum...

SendVirtualKeystroke( 0x00|0x70, true, false, false, false )

is shift + F1

Now I can finally switch to TV and to Monitor (TVTool) via Salling Clicker...
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Sat Jan 14, 2006 6:27 pm    Post subject: Reply with quote

Hi,

0x00|0x70 is the same as 0x70.

Best.
--
Jonas

[quote="daffy"]Found the solution after a small search in this forum...

SendVirtualKeystroke( 0x00|0x70, true, false, false, false )

is shift + F1

Now I can finally switch to TV and to Monitor (TVTool) via Salling Clicker...[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
daffy
Junior Member


Joined: 14 Jan 2006
Posts: 36
Location: Erlangen, Germany

PostPosted: Sat Jan 14, 2006 11:28 pm    Post subject: Reply with quote

Thanks a lot.
I found a much more convenient way to control TVTool. Its realised by the following script. The parameter /switch can be exchanged via all the other possible paramters for diffenernt controls. This script switches between TV and monitor.

var wsh = new ActiveXObject('WScript.Shell');
var TVToolPath = wsh.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\TVTool8\\CurrentDirectory");
if( TVToolPath != null ) {
new ActiveXObject("Shell.Application").ShellExecute( TVToolPath+"\\tvtool.exe","/switch","","",2);
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group