Select whole words when mouse hovers over

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Elermino
Posts: 114
Joined: 29 Nov 2021, 17:43

Select whole words when mouse hovers over

Post by Elermino » 24 Jun 2022, 17:30

If the cursor is of the IBeam type and the F20 key is pressed, the text is selected with the shortcut Ctrl + Shift + right (or in the direction to which it is moved).

Is there any way of doing this?
https://imgur.com/a/Rqrfwjk

I have this code but it is based on the number of pixels moved and not on whether the cursor is over a word

Code: Select all

#If WinActive("ahk_exe chrome.exe") && A_Cursor = "IBeam"
~LButton::
Click
MouseGetPos, x1
SetTimer, Check, 100
SoundBeep, 1500
KeyWait, LButton
SetTimer, Check, Off
SoundBeep, 1000
Return
#If

Check:
MouseGetPos, x2
f := Floor(Abs((x2 - x1) / 110))
Switch
{
 Case x2 > x1: Send ^+{Right %f%}
 Case x2 < x1: Send % "{Right}^+{Left " f + 1 "}"
}
Return

shanshans
Posts: 27
Joined: 13 Dec 2015, 08:10

Re: Select whole words when mouse hovers over

Post by shanshans » 25 Jun 2022, 00:33

Not so sure what you want. If i need to select a word only, point the mouse to that word and double click on it . If it is a sentence triple click.

User avatar
Elermino
Posts: 114
Joined: 29 Nov 2021, 17:43

Re: Select whole words when mouse hovers over

Post by Elermino » 25 Jun 2022, 07:39

shanshans wrote:
25 Jun 2022, 00:33
Not so sure what you want. If i need to select a word only, point the mouse to that word and double click on it . If it is a sentence triple click.
I know it is a complicated issue, so I would like to know if there is a way. I half achieved it by sending 2 clicks when the cursor is IBeam (or text) type and when scrolling 50px in one direction I sent the command Ctrl + Shift + (left or right depending on the direction in which it goes), but it does not work like I want is to select the word when hovering over it. I appreciate any help

Post Reply

Return to “Ask for Help (v1)”