Random "bugs" in Autohotkey? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
RickC
Posts: 250
Joined: 27 Oct 2013, 08:32

Re: Random "bugs" in Autohotkey?

13 Feb 2018, 14:51

Masonjar13 wrote:You've had more help than I believe you're deserving of with your attitude, so I will leave this here. If you decide you'd like to be more receptive to learning, by all means, I thoroughly encourage you to do so; this site has a plethora of content to tantalize your neurons.
I'm not sure at all that it's Nixcalo with the attitude. I'm really sorry to see the direction this thread has taken.
User avatar
Masonjar13
Posts: 1517
Joined: 20 Jul 2014, 10:16
GitHub: Masonjar13
Location: Не Россия

Re: Random "bugs" in Autohotkey?

13 Feb 2018, 15:59

RickC wrote:I'm not sure at all that it's Nixcalo with the attitude. I'm really sorry to see the direction this thread has taken.
Agreed, it's wildly off-topic. And there's a difference between rude and honest, though I'm aware most can't discern. Harsh, perhaps. Funny how he took it better than you did.. :eh:

If you genuinely have a concern, why didn't you contact me directly? Also, I'm not an admin, those are in red (such as lexikos).

This thread couldn't be more off-topic at this point, so if anyone has anything unrelated to OP to say, please create another thread, PM, etc., thanks. :thumbup:
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
RickC
Posts: 250
Joined: 27 Oct 2013, 08:32

Re: Random "bugs" in Autohotkey?

13 Feb 2018, 16:09

Masonjar13 wrote:Funny how he took it better than you did..

If you genuinely have a concern, why didn't you contact me directly? Also, I'm not an admin, those are in red (such as lexikos).
Whether 'he' took it better is irrelevant IMO. I'm disappointed you now feel the need to criticise me for my opinion. Perhaps you could have contacted me directly?

('admin' as in 'administration staff', not 'Administrator')
User avatar
Blackholyman
Posts: 1292
Joined: 29 Sep 2013, 22:57
Facebook: socialjsz
Google: +Jszapp
Location: Denmark
Contact:

Re: Random "bugs" in Autohotkey?

14 Feb 2018, 04:47

Nixcalo wrote:As a little update, Xtra solution does not work 100% of the time. I would say about 90%, which is way greater that the other solutions and it's definitely an improvement. Sometimes it does not work and what it does is delete what was selected, without replacing it with anything... but a great improvement nonetheless and with this success rate, script is a solution rather than a hindrance. THANK YOU! (Perhaps I have to add some "sleep" somewhere.."
sadly you never got around to answer guest3456
guest3456 wrote:can you state what exactly you are doing when it fails? what app are you using? what keys are you pressing? are you running the ^u script standalone or as part of a larger script?
I will point out
ClipWait wrote:Waits until the clipboard contains data...
Aka you have to give it the right conditions to work with, seen from your use case.

One example is if you wish to check that a copy command has worked, you can empty the clipboard and use clipwait, as that waits for it to contain data at some point, by using the timeout param you can make sure it acts even if no data comes to the clipboard within a given timeframe.

but the second ClipWait in the code you find to be working 90% of the time, really does nothing as the clipboard at this point is not empty so the clipwait commands condition will always be true...

I'll post yet one more example of the code :) yeah

Code: Select all

^u:: ; ctrl+u

; Making sure keys are up before continuing
KeyWait, Ctrl
KeyWait, u

; Put a blank string on the clipboard to clear it (for clipwait to work)
clipboard:=""

; Send the keys that tells the program to issue a cut to clipboard
Send, {Ctrl Down}x{Ctrl Up}

; wait for the clipboard to contain data (2 second wait before continuing on and Errorlevel is set to one)
ClipWait, 2
if (ErrorLevel) ; two seconds passed without the clipboard containing data
	return 		; so end hotkey routine execution, the cut may have happened but no paste will be done

; grab the data on the clipboard and store it in a variable we control
Variable_holding_the_string_from_the_clipboard := Clipboard

; use autohotkey functions to interact with the data in our own variables (upping a string in this case)
Variable_holding_the_string_from_the_clipboard_upped := Format("{:U}", Variable_holding_the_string_from_the_clipboard)

; putting the now upped string back on the clipboard
Clipboard := Variable_holding_the_string_from_the_clipboard_upped

; Send the keys that tells the program to issue a paste from the clipboard
Send, {Ctrl Down}v{Ctrl Up}

return ; end
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:
Stenemo
Posts: 9
Joined: 25 Dec 2015, 04:48
Facebook: Stenemo
GitHub: MarkusStenemo

Re: Random "bugs" in Autohotkey?

26 Apr 2018, 04:34

Helgef wrote: You might want to consider to install the keyboard hook. See #HotkeyModifierTimeout.
That will not stop ahk from pushing it back down after the send.
I have also had this problem, posted my solution here: https://stackoverflow.com/questions/490 ... -key-stuck, although I am still looking for a better solution.

One solution I have thought of that theoretically could solve it would be to have a similar system as exist for numlock,
scrolllock and capslock: https://autohotkey.com/docs/commands/Se ... kState.htm
SetCapslockState, Off
SetStoreCapslockMode, off


Having the equivalent for ctrl, e.g.
SetControlState, Off
SetStoreControllockMode, off
could in theory solve it. Would this be a possible solution?

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, Chunjee, Conrad_Smuts, electrone77, jarhead, leehere10, mikeyww, Rohwedder, roonyroox, Visioneer, yumuffin and 60 guests