Can a Function Key be mapped to launch an Application in XP?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
reconsulting
Newbie
Posts: 1
Joined: Fri Sep 07, 2007 2:52 am

Can a Function Key be mapped to launch an Application in XP?

Post by reconsulting » Fri Sep 07, 2007 3:02 am

I realize with Macro Scheduler you can assign a hotkey to run an executable file. Yet what I'm trying to find out is if there is a way to actually remap a Function key to launch an application I've created with MS within windows XP.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Sep 07, 2007 5:02 am

Back in the DOS era we used to use escape characters to remap the keyboard. I think you can do that now in the registry but I'm not certain of that. However you can use Macro Scheduler to create a script that will wait for a keypress by using OnEvent>.

This example will run until you kill it using Shift+Esc or until you press the F11 key. Pressing F11 will open notepad and close the script.

Code: Select all

OnEvent>KEY_DOWN,VK122,0,RunNotepad

Label>Loop
Wait>0.01
Goto>Loop

SRT>RunNotepad
  Run>notepad.exe
  Goto>EOF
END>RunNotepad

Label>EOF

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Sep 07, 2007 7:11 am

I might have missed the point of the question but I'm not sure how that is any different to simply creating a macro that launches Notepad and assigning the macro a hotkey under macro properties.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Sep 07, 2007 2:19 pm

This Microsoft link has information about using the registry to remap the keyboard. Back under DOS you could have a key launch a program. I'm not sure that would be possible using this registry remap technique. For one thing this requires a reboot to function so this is not a technique you would use on the fly. Maybe reconsulting will look into this and let us know.
I might have missed the point of the question but I'm not sure how that is any different to simply creating a macro that launches Notepad and assigning the macro a hotkey under macro properties.
One major difference would be I can compile the script and the OnEvent. "hotkey" will work on any computer. Another difference might be you could have the user select a key to be used as a hotkey during script execution.

That said, If your point is that software specific hotkey assignment is not the same as keyboard remapping I believe you are correct. I have no knowledge of what is really happening with the Macro Scheduler hotkey assignment but my understanding is that keyboard remapping changes the scan codes whereas software hotkey assignment changes the usage of the scan code. Feel free to correct me or elaborate, I have very little knowledge on this subject.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Sep 07, 2007 2:22 pm

I think I just don't quite know exactly what reconsulting wants.

Want a key sequence to start an EXE and you don't have Macro Scheduler? Create a shortcut to the EXE/Application. Right click on it and select Properties. There you will see an entry called "Shortcut Key". Enter the key sequence you want to trigger it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Sep 07, 2007 2:49 pm

Sounds like reconsulting wants to use just a function key, but a shortcut needs CTRL+ALT plus another key.

Update: Well, that's not true, but it is what the shortcut tooltip shows. A shortcut can use a function key.

Image

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts