Jump to content
Sign in to follow this  
Guest robert

Please assist with creating two Hotkeys

Recommended Posts

Guest robert

Greetings :dance: to all of you

Firstly, I would like to take this opportunity to thank all the people involved who have contributed to help this awesome software evolve. Keep up the great work :(

:dance: I have a relatively simple query (for you folks) but not so simple for someone like me :"> who isnt too well versed with script writing and I truly hope someone can assist me with solving my problem. :whistle:

I would like to create two hotkeys as per the following.

The First Hotkey is

I would like to assign a Hotkey to the Insert button. The action that it should trigger would be (sequence of keys that the Hotkey should emulate) NumEnter (the Enter key on the Numeric Keypad) followed by the Right Control (RCtrl).

The Second Hotkey is

I would like to assign a Hotkey to the * button on the Numeric Keypad. The action that it should trigger would be (sequence of keys that the Hotkey should emulate) Shift F3, Up Arrow, TAB, Up Arrow, TAB, Backspace, TAB, Backspace, TAB, Up Arrow, NumEnter, Right Control.

PLEASE NOTE

For BOTH these Hotkeys - ONLY the Num Enter key on the Numeric Keypad will work for this software where I intend using this hotkey. The other Enter key will NOT work. Similarly, ONLY the Right Control key will work for this software where I intend using this hotkey. The Left Control key will NOT work.

I earnestly request someone to please forward a ready-made script one which I can cut and paste so as to avail these hotkeys.

Also, I would like to use both these Hotkeys in the same program. If there is a way that AutoIt can be told to trigger these Hotkeys ONLY in this software then please include those details in this script something like run only when this Window is Active or on Top etc. The name of the Window for this software is NEAT.

Your assistance for the above would be highly appreciated and Thanx! in advance :D

Regards,

Robert Goodman

Share this post


Link to post
Share on other sites
Gigglestick

See the HotKeySet documentation. It says the NumPad's Enter key cannot be used as a HotKey. Search the forum for a DllCall for hotkeys. I think there's a DLL you can tap into that can watch for that specific key.

As for the other keys:

HotKeySet("{INSERT}", "_ProcessInsertKey")
Func _ProcessInsertKey()
   Send("{ENTER}{RCTRL}")
EndFunc

Second hotkey:

HotKeySet("{NUMPADMULT}", "_ProcessStarKey")
Func _ProcessStarKey()
   Send("+{F3}{UP}{TAB}{UP}{BACKSPACE}{TAB}{BACKSPACE}{TAB}{UP}{ENTER}{RCTRL}")
EndFunc

*EDIT* As for the NumPadEnter, you'll have to search the forum. I don't know how to trap that specific key if HotKeySet doesn't do it.

Edited by c0deWorm

My UDFs: ExitCodes

Share this post


Link to post
Share on other sites
Guest robert

Hi! Codeworm

Thank you so much for your post. I think there must have been some misunderstanding in what I have written. I do NOT want the Numpad Enter key AS a Hotkey - I would like to use it IN a Hotkey. The Numpad Enter key is simply one of the keys that features in the sequence for the Hotkey.

Like for Example - I read the code that you have scripted for using the Insert key as a Hotkey - namely -

HotKeySet("{INSERT}", "_ProcessInsertKey")

Func _ProcessInsertKey()

Send("{ENTER}{RCTRL}")

EndFunc

BUT

this Hotkey will NOT work if it isn't the Numpad Enter key that gets triggered.

As I have two consecutive days holidays, I will be able to try this script only once I reach my office on 8/Sep/2005. I will revert back and let you know if it works.

Meanwhile, can someone please let me know how I can overcome this Numpad Enter problem.

Share this post


Link to post
Share on other sites
BigDod

HotKeySet("{INSERT}", "_ProcessInsertKey")
Func _ProcessInsertKey()
Send("{NUMPADENTER}{RCTRL}")
EndFunc

Try this



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
Gigglestick

HotKeySet("{INSERT}", "_ProcessInsertKey")
Func _ProcessInsertKey()
Send("{NUMPADENTER}{RCTRL}")
EndFunc

Try this

<{POST_SNAPBACK}>

Well slap my ass and call me Sally! I confused myself on it being the hotkey and being sent using Send. Nice catch, BigDod. Did this work for you, robert?

My UDFs: ExitCodes

Share this post


Link to post
Share on other sites
Guest robert

Did this work for you, robert?

<{POST_SNAPBACK}>

Well I am itching to try this code out. I can do so only on 8/Sep/2005. Will revert back to you folks once I experiment with it.

Until then - Thank you a plenty for your continual support...

By the way - I needed to know if it were possible to assign this Hotkey to work only in a program specific environment instead of having a Global setting. Like for example - NumPadMult should work as a Hotkey in a window called NEAT where I would like to use it and say as it's original function - that is - a multiplication key in the Calculator. Please do let me know the script / code for the same.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×