Search found 17 matches

by Saiapatsu
13 Nov 2023, 23:34
Forum: Wish List
Topic: CtrlTab command analogous to AltTab
Replies: 5
Views: 1053

Re: CtrlTab command analogous to AltTab

The existence of the AltTab function seems unusual to me in the first place. I guess that AHK needs to do something special to manipulate the Alt-Tab menu properly and Send "!{Tab}" doesn't cut it. But because there's no OS-level Ctrl-Tab thing going on, you can simply remap your key to Ctrl-Tab wit...
by Saiapatsu
31 May 2023, 04:23
Forum: Wish List
Topic: Allow un-sinking the key that triggered a hotkey without resending it
Replies: 1
Views: 987

Allow un-sinking the key that triggered a hotkey without resending it

This is actually possible in AutoHotkey already even though I remember people telling me it's impossible years ago in IRC. See this script for an example: The gist of it: #HotIf Foobar() f::return #HotIf ; Every odd F key press is consumed and every even F key press plays a sound. Foobar() { static ...
by Saiapatsu
31 May 2023, 04:01
Forum: Ask for Help (v2)
Topic: Double press = Hotkey
Replies: 2
Views: 454

Re: Double press = Hotkey

I've been meaning to write a script like this to prove a point to someone. You don't need to fully understand it, this script abuses an AHK feature in an unusual way. ; When CapsLock is pressed, call PressedCaps(). Still toggles CapsLock ; because PressedCaps() returns 0, meaning the actual hotkey i...
by Saiapatsu
09 May 2023, 05:34
Forum: Ask for Help (v2)
Topic: lock mouse cursor axis while key held
Replies: 8
Views: 974

Re: lock mouse cursor axis while key held

Here's a script that prevents the mouse from moving vertically while Left Alt is held. The mouse remains on the same Y position as it was when the key was pressed - if you'd like it to go to a specific Y position, replace mouseY with it. Note the A_ScreenWidth in there. I can not test this in a mult...
by Saiapatsu
26 Feb 2023, 09:08
Forum: Suggestions on Documentation Improvements
Topic: RegExReplace backreferences cannot be manipulated
Replies: 21
Views: 4016

Re: RegExReplace backreferences cannot be manipulated

In my view, the following sum is 26, and so this is the meaning of adding the orange to the apple-- in some situations. #Requires AutoHotkey v2.0 num := RegExReplace("number23", ".*?(\d+)", "$1") MsgBox 3 + num MsgBox 3 + "23" num := RegExReplace("number23", ".*?(\d+)", 3 + "$1") This would replace...
by Saiapatsu
25 Feb 2023, 06:46
Forum: Suggestions on Documentation Improvements
Topic: RegExReplace backreferences cannot be manipulated
Replies: 21
Views: 4016

Re: RegExReplace backreferences cannot be manipulated

The documentation is already 100% perfectly clear what Replacement is: it is a string. You seem to think that it RegExReplace takes some special and magical argument, but no, it is nothing more than a string. The catch here is that RegExReplace also interprets Replacement and replaces any $number, $...
by Saiapatsu
25 Feb 2023, 06:00
Forum: Suggestions on Documentation Improvements
Topic: A_LastError's docs do not mention that OSError() can get the error description Topic is solved
Replies: 1
Views: 1386

A_LastError's docs do not mention that OSError() can get the error description Topic is solved

I had formulated a function to get the description of a Windows error code because the documentation for https://www.autohotkey.com/docs/v2/Variables.htm#LastError did not actually link any specific place to read about the error codes. I was told that AutoHotkey v2 already has this built-in: one can...
by Saiapatsu
25 Feb 2023, 05:33
Forum: Scripts and Functions (v2)
Topic: A_LastError to string
Replies: 3
Views: 727

Re: A_LastError to string

Good works, but there is one that does some of the same in v2. MsgBox OSError(7).Message You see what I mean? :) AutoHotkey's documentation is usually so good that I always trust it and take its descriptions and examples at face value. I will be filing a documentation improvement because I think A_...
by Saiapatsu
24 Feb 2023, 09:41
Forum: Scripts and Functions (v2)
Topic: A_LastError to string
Replies: 3
Views: 727

A_LastError to string

errname(code) { DllCall("FormatMessage" , "Int", 4864 ; FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS ; dwFlags , "Ptr", 0 ; lpSource , "Int", code ; dwMessageId , "Int", 1024 ; MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) ; dwLanguageId , "Ptr*", &bufMsg ...
by Saiapatsu
17 Feb 2023, 08:07
Forum: Scripts and Functions (v2)
Topic: [v2.0.2] Auto-hide auto-hidden taskbar (Experimental)
Replies: 0
Views: 552

[v2.0.2] Auto-hide auto-hidden taskbar (Experimental)

The Auto-Hide Taskbar setting does not hide the taskbar, it leaves an annoying two pixel tall sliver behind. This script uses a simple mouse hook (based on OnMouseEvent ) to appropriately hide and show the taskbar as the mouse moves to and from the bottom of the screen independently of its own hide/...
by Saiapatsu
11 Feb 2023, 13:55
Forum: Scripts and Functions (v2)
Topic: [v2.0.2] File path to file ID and back again
Replies: 3
Views: 938

Re: [v2.0.2] File path to file ID and back again

Hi, I was just wondering, in your specific use case, if you have any reason to not use the filepath itself that is also an unique identifier for the file. Yes. I rename the files. Each file's path is %screenshots%\<year><month> <category>\<14-digit date> <description> . Ideally I'd write the descri...
by Saiapatsu
09 Feb 2023, 11:48
Forum: Scripts and Functions (v2)
Topic: [v2.0.2] File path to file ID and back again
Replies: 3
Views: 938

[v2.0.2] File path to file ID and back again

; https://www.codeproject.com/questions/273746/given-an-ntfs-file-id-is-there-any-official-way-to ; Get 64-bit NTFS file index (or whatever it's supposed to be called) in two halves. ; Optionally specify a VarRef to get the file handle. You are responsible for closing it. ; DllCall("CloseHandle", "...
by Saiapatsu
28 May 2022, 02:56
Forum: Scripts and Functions (v2)
Topic: OnMouseEvent.ahk - Call back whenever the mouse moves, clicks or scrolls
Replies: 1
Views: 1355

OnMouseEvent.ahk - Call back whenever the mouse moves, clicks or scrolls

Include this script and use OnMouseEvent(Function, AddRemove) exactly as you would use OnExit or OnMessage . Function will get an object as an argument (which is actually the OnMouseEvent class itself), read its properties (getters) to get information about the event. Based on MouseDelta by evilC. h...
by Saiapatsu
21 Mar 2022, 17:26
Forum: Tips and Tricks (v1)
Topic: Prevent Win from opening the Start menu [Any Version]
Replies: 6
Views: 5679

Prevent Win from opening the Start menu [Any Version]

~LWin::vkE8 Now pressing the Win key by itself will not show the Start menu, yet you may use any Win key hotkey. With the Win key thus disabled, the Start menu can also be opened by pressing Ctrl+Esc. The Start menu will only appear if the Win key was pressed and released without any other key bein...
by Saiapatsu
06 Mar 2022, 22:22
Forum: Scripts and Functions (v2)
Topic: child_process, asynchronous reading child process's stdout/stderr
Replies: 8
Views: 2259

Re: child_process, capture child process's stdout/stderr outputs

Thank you so much for this module, the async/functional behavior is awesome. I think this is what will motivate me to finally port my scripts from 2a to 2b. (I have not tried this script yet, but will after I do that) However, I'd like to point out that escapeparam() is a little bit naive. Right now...
by Saiapatsu
14 Feb 2021, 19:57
Forum: Scripts and Functions (v2)
Topic: [a123] showlink.ahk — navigate to hardlinks of file
Replies: 1
Views: 1381

[a123] showlink.ahk — navigate to hardlinks of file

I'm putting this here because I found no examples of FindFirstFileNameW and FindNextFileNameW usage in AHK. ; showlink.ahk <path> ; reveals all locations hardlinked to path ; path must be complete ; does not show target location; shows first location in active explorer window ; opens new explorer wi...
by Saiapatsu
11 Dec 2019, 05:07
Forum: Scripts and Functions (v1)
Topic: Toggle ClearType with a hotkey
Replies: 0
Views: 935

Toggle ClearType with a hotkey

This script will toggle ClearType any time you hold the Windows key and press F. Most applications will not update their text immediately - usually scrolling around will repaint the text with the new setting. #f:: ; Instantly toggle ClearType ; Relevant documentation: ; https://docs.microsoft.com/en...

Go to advanced search