Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Sendkeys... Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
rmackay
Groupie
Groupie


Joined: December 15 2003
Location: United States
Online Status: Offline
Posts: 28
Posted: January 30 2004 at 00:58 | IP Logged Quote rmackay

Where do I find documentation on how to code the sendkeys function? I want to sent an Alt-F4. How do I specify that in the function?
Back to Top View rmackay's Profile Search for other posts by rmackay
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: January 30 2004 at 13:45 | IP Logged Quote TonyNo

In the manual, page 36...

"{alt+F4}" should work.

Tony

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
rmackay
Groupie
Groupie


Joined: December 15 2003
Location: United States
Online Status: Offline
Posts: 28
Posted: February 25 2004 at 16:53 | IP Logged Quote rmackay

Ok - I got a stumper... in a test scenario, I thought it would be cool to have my office PC shoo away unauthorized visitors. So, when I leave for the night I set a global var to 1 which 'arms' my system. I then have a motion sensor that when motion is detected, waits 15 seconds for a dis-arm, if not, it fires on my desk lamps and using TTS, instructs the visitor to leave the office at once.

The problem is when I arm the system. I currently have a macro (triggered by a  remote) that announces the systems is armed and sets the global variable. I also want it to do a send keys to lock my PC for me. To do this, I need to send a Ctrl-Alt-Delete, and then send a 'k'. However, I can not get

ph_sendkeys("{ctrl+alt+delete}k")

to work at all. Any suggestions?

Thank you - Robert

Back to Top View rmackay's Profile Search for other posts by rmackay
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: February 25 2004 at 17:59 | IP Logged Quote mustangcoupe

robert,

Are you trying to send crtl-alt-del K at the same time...

If not I bleive you have to make those two different lines.....
And if power home used the same syntex as VB then isnt it going to be

ph_sendkeys("^%{del}"),true
ph_sendkeys("K)

^ = ctrl
and % = alt

Todd



__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: February 25 2004 at 18:57 | IP Logged Quote dhoward

Robert,

Well, the Control-Alt-Delete combination cant be simulated with a Sendkeys.  You've got the right syntax if it could, but from the research Ive done on the web, this just doesnt work.

However, I do know how you can do it.  Use the following formula:

ph_run("Rundll32.exe user32.dll,LockWorkStation")

This will automatically lock your workstation down.

Hope this helps,

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
rmackay
Groupie
Groupie


Joined: December 15 2003
Location: United States
Online Status: Offline
Posts: 28
Posted: February 26 2004 at 00:05 | IP Logged Quote rmackay

AWESOME! ph_run("Rundll32.exe user32.dll,LockWorkStation") is exactly what I needed! Thank you!

 

Back to Top View rmackay's Profile Search for other posts by rmackay
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: February 26 2004 at 10:05 | IP Logged Quote dhoward

Robert,

Glad it worked.  Just let me know if you have any other questions like that and I'll be glad to help.

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
rmackay
Groupie
Groupie


Joined: December 15 2003
Location: United States
Online Status: Offline
Posts: 28
Posted: February 26 2004 at 10:25 | IP Logged Quote rmackay

I'll take you up on that offer. Is there anyway to flag a macro to run on startup of PowerHome? Like an autoexec.bat type of thing? If my PC recycles when I am not there, I want Powerhome to start with certain values for the variables, etc.
Back to Top View rmackay's Profile Search for other posts by rmackay
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: February 26 2004 at 10:39 | IP Logged Quote dhoward

Robert,

Thats an easy one...Just create a macro with an ID of STARTUP.  This macro is automatically executed anytime PowerHome is started.

The next release will also run any macro labeled SHUTDOWN when PowerHome is shutdown.

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: February 26 2004 at 13:10 | IP Logged Quote TonyNo

"The next release will also run any macro labeled SHUTDOWN when PowerHome is shutdown"

Darn good idea!

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
hscehome
Newbie
Newbie
Avatar

Joined: May 24 2004
Location: United States
Online Status: Offline
Posts: 3
Posted: June 08 2004 at 17:35 | IP Logged Quote hscehome

I am looking to use powerhome to control my sage tv i want to be able to move through the menus and select options... how do i move up and down or simulate pushing the up arrow key or down arrow key and for selection i've tried to send key "{enter}" but it doesnt work could i be missing something
Back to Top View hscehome's Profile Search for other posts by hscehome
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 09 2004 at 10:34 | IP Logged Quote dhoward

When using sendkeys, the application that you are trying to control must have focus.  You want to do this with the switchto macro command or formula function.  An example using formulas is below:

ph_switchto("Title of the Sage Window",1) + ph_sendkeys("{downarrow}{downarrow}{enter}")

The above formula will give the Sage Window focus and then simulate the down arrow key being pressed twice followed by the enter key.  When using the ph_switchto function, you can search either by the title of the window or the class name.  You can use various freeware utilities found on the web to find out the class name of a window.  If you do search by classname, the second parameter must be a 0.

HTH,

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum