ZerofeniX Posted February 21, 2013 Share Posted February 21, 2013 I'm am trying to create a script that allows me to remap certain key presses. For instance an application I am using does not support shift modifiers as it is souly reserved for another purpose but some hot keys are not effected by the built in shift modifier so I would like to make hotkeys that use shift and perform useful actions for instance Shift+Z is unusable but I would like to make it so that when Shift+Z is pressed it will send "j" instead. The other problem is that I want this to happen dynamically so I can't simply make a function that will send a j. Any suggestions? Link to comment Share on other sites More sharing options...
PhoenixXL Posted February 21, 2013 Share Posted February 21, 2013 (edited) HotKeySet("+z", "j") While 1 Sleep(10) WEnd Func j() Send("j") EndFuncThis should help Edit: Ask a moderator to move your Topic to the GENERAL HELP AND SUPPORT you will receive more help there Edited February 21, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
ZerofeniX Posted February 21, 2013 Author Share Posted February 21, 2013 Yeah, I was hoping someone would have an easier way than simply making functions for each individual key send. Because for what I'm doing I'll have to make one for each key on the key board XD Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2013 Moderators Share Posted February 21, 2013 ZerofeniX,Because for what I'm doing I'll have to make one for each key on the key boardThen do not post the result here - we would consider that script as a basic keylogger and so prohibited by the Forum rules (there is also a link at bottom right of each page). M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ZerofeniX Posted February 21, 2013 Author Share Posted February 21, 2013 (edited) Thanks, but the purpose of my script is clearly stated in my first post. Second question, Say I have this scenario, which shouldn't come up with my script but if it were to happen is there any way around it would knowing what the original hotkey is? Desired output: press shift+z -> J Actual Output: press shift+z -> i HotKeySet("+z", "_j") HotKeySet("j", "_i") Func _j() Send("j") EndFunc Func _i() Send("i") EndFunc While(1) Sleep(10) WEnd [ Edited February 21, 2013 by ZerofeniX Link to comment Share on other sites More sharing options...
Developers Jos Posted February 21, 2013 Developers Share Posted February 21, 2013 (edited) Thanks, but the purpose of my script is clearly stated in my first post... and your point is what? The statement made still counts and we do not really care about good or bad intentions as there is no way for us to verify either.The reason for your finding is pretty simple ..... you have an hotkey active at the time you do a Send("j") command.Jos Edited February 21, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2013 Moderators Share Posted February 21, 2013 ZerofeniX,Thanks, but the purpose of my script is clearly stated in my first postI do not care what function your script is supposed to perform - but using HotKeys on the entire keyboard is essentially a keylogger and will be dealt with as such. What I gave you was a friendly warning not to post such a thing here - on your head be it if you do not follow that advice. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ZerofeniX Posted February 21, 2013 Author Share Posted February 21, 2013 The reason for your finding is pretty simple ..... you have an hotkey active at the time you do a Send("j") command. Yes, I understand that, but is there any way to prevent the Send() function from triggering the hotkey without first unregistering the hotkey? I do not care what function your script is supposed to perform - but using HotKeys on the entire keyboard is essentially a keylogger and will be dealt with as such. What I gave you was a friendly warning not to post such a thing here - on your head be it if you do not follow that advice. I am aware that a script that HotKeys all the keys on a keyboard would be a keylogger. But, I did not say that I was making HotKeys for the entire keyboard, but functions to send each key on the keyboard, because my script is going to allow you to bind specific key combinations to other keys on the keyboard. It will do this because the shift and ctrl modifiers are reserved by the program I am designing the script for. Func _a() Send("a") EndFunc Func _b() Send("b") EndFunc ... Func _z() Send("z") EndFunc etc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now