ladersoft Posted April 22, 2018 Share Posted April 22, 2018 I need a simple script to remap some keys on keyboard, I need to remap LCTRL and LALT so can't use HotKeySet. I've made a basic script to map Left control to D : #include <Misc.au3> While 1 Sleep (50) If _IsPressed("A2") Then Send("{D}") EndIf WEnd I launch it and LCONTROL is remapped into D letter, but when i press Lcontrol more than one time, after 2 or 3 times the D key is sent continuosly to pc like it was hold down permanently... so after 2 o or 3 keystrokes if I'm, for examples, in word, i see on my screen somethings like DDDDDDDDDDDDDDDDD and it go on a sort of infinite loop, to stop it I must end the script. maybe after some second it stop random then restart.... tried on different pc so is not a pc or windows issue. but the script is very simple... any ideas? thanks Link to comment Share on other sites More sharing options...
bernd670 Posted April 22, 2018 Share Posted April 22, 2018 Hello, try this #include <Misc.au3> While 1 Sleep (50) If _IsPressed("A2") Then Send("{D}") ; Wait until key is released. While _IsPressed("A2") Sleep(50) WEnd EndIf WEnd greetingsbernd I hacked 127.0.0.1 -> Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2018 Moderators Share Posted April 22, 2018 ladersoft, I see you did not read those rules to which you were linked very carefully - you missed the part that says: "Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above" Do NOT start another thread on this - our patience has limits. 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...
Recommended Posts