No way to programmatically hold down the control-key persistently?

Get help with using AutoHotkey and its commands and hotkeys
LM_
Posts: 6
Joined: 11 Mar 2019, 09:30

No way to programmatically hold down the control-key persistently?

09 Nov 2019, 07:57

1)

My first try, to be triggered by another key combination:

Code: Select all

TOGGLE_CONTROLDOWN:
; syscontroldown is global
if syscontroldown = 0
{
	syscontroldown = 1
	send, {ctrl down}
}
else ; syscontroldown = 1
{
	syscontroldown = 0
	send, {ctrl up}
}
return
Then, from superuser.com, for a similar problem of somebody else:
When a key is held down via the method above, it does not begin auto-repeating like it would if you were physically holding it down (this is because auto-repeat is a driver/hardware feature).
However, a Loop can be used to simulate auto-repeat. The following example sends 20 tab keystrokes:
(...)
= a loop, I've also seen examples with timers. I then tried this advice of another page:

Code: Select all

send, {ctrl down}
keywait, ctrl, L
return
But that didn't work as expected either, so the above "it's a hardware thing" obviously applies.

My question: Isn't there any viable solution to programmatically hold down the control-key up to the user deliberating releasing it (but some other key or by pressing the control-key, that wouldn't matter), perhaps by going further down into the system?

Obviously, this functionality would be extremely helpful
- for selecting lots of file manager entries in a long list, especially if you need your second hand (not for holding down the control-key but) for browsing to another (!) list
- ditto for selecting lots of pictures in a photo browser
- and also for selecting multiple elements in (e.g. vector) graphic programs, there again especially if you need your other hand (than your mouse hand, for clicking on the elements) for browsing a (printed or on-screen) list.

So the general relevance for this need is obvious... and there should not have been a single real solution to the problem in the last 30 years?

Or do I overlook a possible solution? Perhaps a timer, combined with fetching mouse clicks? With "onclick" renewing the timer, or something? I did not try such things yet I admit:

The usual Logitech and many other mice do NOT allow for re-assigning the left (or right) mouse button to something else, so I could not devise a script like "mouse click renews some script", but the click would be sent and thus very probably kill the previous selection, so that a script running in the background, by timer, and which would try to retrieve clicks by "onclick", would NOT be effective?

2)

If there is NO solution for "regular" mice (???), the solution would obviously lie within switching to / buying a mouse which allows for re-assigning the left (or right) mouse key to a sending a key combination.

Then, that key combination would be assigned in AHK to something like

Code: Select all

+^!F12:: ; assigned to main mouse button
if sysvar xx =  0 ; regular / default state
    send, {click} ; on current mouse position
else
    send, ^{click} ; again on current position
with another such key combination toggling the sysvar (and perhaps showing a red AHK gui (square 150x150 pix to remind you), since at the end of the day, it's not even necessary to hold down the control-key, it's just necessary that every further mouse click be a control-click again.

That way, the simplest solution to the problem would be such a, really freely-assignable, mouse, but I don't find any; so-called "reviews" never mention (or even see) the problem; the usual mouse software for the makes in question can be downloaded and installed, but then say "no device found", and that's it, without you being able to check if the main buttons are re-assignable to a key combination, too. (Microsoft: not; Logitech: not; do you know makes / models where that would be possible though?)

3)

After having better identified the problem, I'll also ask on general computer sites, for solution 2), but I would certainly be highly interested in hearing about any possible solution 1).

Thank you very much!

Return to “Ask For Help”

Who is online

Users browsing this forum: flyingDman, Google [Bot], nohofako, vakacjus and 218 guests