Emerogork Posted August 22, 2023 Posted August 22, 2023 (edited) There is/was a child's game years ago that helped physically challenged computer users in eye/hand coordination. You used the mouse to approach the cat on the screen and the cat jumps away. I am looking for the code for this to be used in a much more practical sense. To be clear, I am not developing or modifying a game. The description is strictly to help develop the software to cure a problem. I just want to see if this can be written using AutoItScript. What I need is a program that: .1) knows the present mouse position, .2) watches the movement of the text-insertion point by text being entered or movement by arrow keys, .3) automatically moves the mouse to avoid the collision. Background: In this case, as when navigating a text document by using the arrow keys, or entering text, there can be a collision of the mouse pointer and the text insertion point. The average person might simply move the mouse to move the pointer away from the text on the screen. The key phrase there is "average person". I am working with savants. These people are so advanced in thinking skills that a mundane interruption like this can be devastating. These are incredibly genius people, but super highly focused, people. The problem is when such a collision happens, their thought patterns get so totally interrupted that it is highly problematic and many times the writer has an extremely hard time getting back on track. I want to write a program that automatically anticipates the collision on the screen and moves the mouse pointer out of the way pre-emptively. I am sure that this might take more explanation but that is the best I can describe it at the moment. What code is available on which should I do research to see how it works, that will help build this project? Edited August 27, 2023 by Emerogork Clarification
Developers Jos Posted August 23, 2023 Developers Posted August 23, 2023 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team 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 August 26, 2023 Moderators Posted August 26, 2023 Hiya, An exchange of PMs with the OP has clarified that this is something he wishes to code in AutoIt - not an automation of an existing application. So the thread is unlocked - please feel free to offer assistance. 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
Nine Posted August 26, 2023 Posted August 26, 2023 It could be done using Notepad or a large edit field in an AutoIt GUI. You could fill it with text (or just numbers from 0 to 9), position the caret in the middle, and move the mouse somewhere away to the caret. WinGetCaretPos will tell you where the caret is located, while MouseGetPos will tell about mouse. If both are getting too close, you just randomly move the mouse a certain distance from the caret with MouseMove. Doable for sure. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
pixelsearch Posted August 26, 2023 Posted August 26, 2023 (edited) In case you're using _WinAPI_GetCaretPos(), just make sure you're using a recent version of AutoIt, as function _WinAPI_GetCaretPos() was bugged in version 3.3.14.5 (2018) and probably in older AutoIt versions. There was an incorrect line in the function, where $tagPOINT was used in DllCall, instead of $tPoint. It has been fixed in AutoIt 3.3.16.1 Local $tPOINT = DllStructCreate($tagPOINT) ... ; DllCall('user32.dll', 'bool', 'GetCaretPos', 'struct*', $tagPOINT) ; AutoIt 3.3.14.5 DllCall('user32.dll', 'bool', 'GetCaretPos', 'struct*', $tPOINT) ; AutoIt 3.3.16.1 Edited August 26, 2023 by pixelsearch
Emerogork Posted August 27, 2023 Author Posted August 27, 2023 On 8/26/2023 at 3:48 PM, Nine said: WinGetCaretPos will tell you where the caret is located, while MouseGetPos will tell about mouse. Looking into it, thanks...
Emerogork Posted September 8, 2023 Author Posted September 8, 2023 Unfortunately, I have to turn away from this programming task to resolve other issues. I can only say that I hope to return to this one in the near future. I thank everyone for their input so far.
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