DarkDragon Posted April 15, 2017 Posted April 15, 2017 When I use Hotkeyset(".") in a script, it doesn't recognize the point, soo doesn't do nothing. I test to use _IsPressed but in a while cycle it doesn't function corectly. Can who help me?
Moderators Melba23 Posted April 15, 2017 Moderators Posted April 15, 2017 DarkDragon, Welcome to the AutoIt forums. It always helps if you show us the script you have been using - see here how to do it. Otherwise we are a bit stuck, as using the "." key as a HotKey works fine for me. 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
DarkDragon Posted April 15, 2017 Author Posted April 15, 2017 $Cont=0 While 1 HotKeySet("E", End) HotKeySet( ".", point_character) WEnd Func point_character() $Cont=$Cont+1 HotKeySet(".") Send(".") EndFunc Func End() Msgbox(0, "How many points have you put?", "You have put: " & $Cont, 1000) Exit EndFunc This is the script.
Moderators Melba23 Posted April 15, 2017 Moderators Posted April 15, 2017 DarkDragon, Try this version: $Cont = 0 ; Just set HotKeys once HotKeySet("+e", End) ; If you want a capital E then ask for Shift-e HotKeySet(".", point_character) While 1 Sleep(10) ; Gives the CPU a chance to breathe WEnd Func point_character() HotKeySet(".") ; Unset the HotKey to avoid firing when sending Send(".") HotKeySet(".", point_character) $Cont = $Cont + 1 EndFunc ;==>point_character Func End() MsgBox(0, "How many points have you put?", "You have put: " & $Cont, 1000) Exit EndFunc ;==>End 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
DarkDragon Posted April 15, 2017 Author Posted April 15, 2017 Thank you for the answer but the code that you send doesn't function.
Developers Jos Posted April 15, 2017 Developers Posted April 15, 2017 Yes it does, that code works fine. How have you determined that it doesn't? 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.
DarkDragon Posted April 15, 2017 Author Posted April 15, 2017 I run the script and It doesn't work. It return 0 on the msgbox.
Developers Jos Posted April 15, 2017 Developers Posted April 15, 2017 How are you testing? Which program is active when you type the "."? 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.
Developers Jos Posted April 15, 2017 Developers Posted April 15, 2017 I do the same and it works fine for me when started from the SciTE editor. 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.
Moderators Melba23 Posted April 15, 2017 Moderators Posted April 15, 2017 DarkDragon, I tested the script running from the SciTE editor - so it looks as though you are doing something different to us. Which app has the focus when you run the script? To which app are you Sending the "." character? 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
DarkDragon Posted April 15, 2017 Author Posted April 15, 2017 I send the "." character to Notepad and it has the focus.
Developers Jos Posted April 15, 2017 Developers Posted April 15, 2017 Again.. that works fine too. Are you sure you just simply run it from SciTE without running it as Admin and the same for Notepad? What happens when you leave the focus on SciTE and type the dots? 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.
DarkDragon Posted April 15, 2017 Author Posted April 15, 2017 Yes I'm sure. Whe I type the dots the program doesn't work because show 0 ont he msgbox
Developers Jos Posted April 15, 2017 Developers Posted April 15, 2017 (edited) Are you using the dot from the numeric keypad? if so change the statement to: HotKeySet("{NUMPADDOT}", point_character) Jos Edited April 15, 2017 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.
Developers Jos Posted April 15, 2017 Developers Posted April 15, 2017 Well I am out of options.... the above work fine for me, the first one with the regular dot and the last one with the numeric pad dot. 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.
Moderators Melba23 Posted April 15, 2017 Moderators Posted April 15, 2017 DarkDragon, Try it with both HotKeySet lines: $Cont = 0 ; Just set HotKeys once HotKeySet("+e", End) ; If you want a capital E then ask for Shift-e HotKeySet(".", point_character) HotKeySet("{NUMPADDOT}", point_character) While 1 Sleep(10) ; Gives the CPU a chance to breathe WEnd Func point_character() ConsoleWrite(@HotKeyPressed & @CRLF) HotKeySet(".") HotKeySet("{NUMPADDOT}") Send(".") HotKeySet(".", point_character) HotKeySet("{NUMPADDOT}", point_character) $Cont = $Cont + 1 EndFunc ;==>point_character Func End() MsgBox(0, "How many points have you put?", "You have put: " & $Cont, 1000) Exit EndFunc ;==>End What do you get in the lower SciTE pane? 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
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