Search found 299 matches

by Noesis
15 Apr 2018, 08:47
Forum: Ask For Help
Topic: how to go about making a hotkey that enables/disables other hotkeys? Topic is solved
Replies: 6
Views: 650

Re: how to go about making a hotkey that enables/disables other hotkeys? Topic is solved

No need for two scripts, you could use suspend, (and ensure the hotkey(s) not needing suspension include a "Suspend, Permit" statement) another way is use the hotkey command eg:

Code: Select all

a:: Send 1
b:: Send 2
c:: Send 3
z:: Send 4
q::
Hotkey, a, Toggle
Hotkey, b, Toggle
Hotkey, c, Toggle
Return
by Noesis
14 Apr 2018, 08:44
Forum: Ask For Help
Topic: Do we need `r`n or simply `n for newlines?
Replies: 6
Views: 747

Re: Do we need `r`n or simply `n for newlines?

I'd also add, that when reading a file take into account both scenarios, i.e. don't assume it will always be `r`n, you're more likely to run into issues. Personally I'd read the file and convert any CRLF's I need to keep as data (if any) into a single LF and use LF internally. Or if I don't need to ...
by Noesis
13 Apr 2018, 01:20
Forum: Gaming
Topic: Hotkey to change mouse dpi?
Replies: 4
Views: 854

Re: Hotkey to change mouse dpi?

Hi guys Just clarifying the *might* aspect of evilC's above post. That type of thing *can* be done in a LGS lua scripted macro. KilliK there is scripting available for each profile in LGS, it's not obvious, and considering you've only recently discovered per app profiles, I doubt you know about it. ...
by Noesis
05 Apr 2018, 02:31
Forum: Ask For Help
Topic: PostMessage sending to 2 windows
Replies: 1
Views: 267

Re: PostMessage sending to 2 windows

My guess is you're missing the wParam, which is meant to be "A handle to the window where the user clicked the button or pressed the key". Since spotify doesn't receive the handle it's presumably passing the message up the chain until it hits the shell level where it essentially becomes a broadcast ...
by Noesis
03 Apr 2018, 02:05
Forum: Gaming
Topic: Making a toggle key for 'BlockInput MouseMove/Off'
Replies: 2
Views: 473

Re: Making a toggle key for 'BlockInput MouseMove/Off'

Your first script would work, however you have a small error in the if statements which stops it working, you are using ":=" which is only ever for assigning a value, and can never be used for checking a value. So you need to change the := to = but only in the two if statements. The code could be cl...
by Noesis
02 Apr 2018, 01:42
Forum: Ask For Help
Topic: How to use Joystick axis to copy & paste without repetition? Topic is solved
Replies: 1
Views: 226

Re: How to use Joystick axis to copy & paste without repetition? Topic is solved

Use a couple of variables to keep track of if the joystick has been moved back to a non-actionable state, and check them as part of the logic to trigger the action. eg: #Persistent SetTimer, WatchAxis, 5 return WatchAxis: GetKeyState, JoyX, JoyX GetKeyState, JoyY, JoyY if (JoyX > 70 && LastX < 70) s...
by Noesis
30 Mar 2018, 22:17
Forum: Ask For Help
Topic: Actions don't work at startup
Replies: 2
Views: 323

Re: Actions don't work at startup

One guess is it could be some kind of focus problem. Perhaps just before sending LWin specifically focus the desktop or taskbar eg: WinActivate("ahk_class Shell_TrayWnd") Another option could be to try opening the start menu using a different method say using controlclick and defining the start butt...
by Noesis
30 Mar 2018, 01:30
Forum: Ask For Help
Topic: Using the mouse wheel in a different way.
Replies: 1
Views: 216

Re: Using the mouse wheel in a different way.

Yes, you can do that, however exactly how it's done depends on how you want the middle button to work, do you ever need it to be held down for a length of time or is a simple press and immediate release always sufficient ? FYI: using wheel tilt hotkeys (i.e. wheelleft, wheelright hotkey names) behav...
by Noesis
15 Mar 2018, 01:25
Forum: Ask For Help
Topic: Programs that resist controlsend?
Replies: 7
Views: 646

Re: Programs that resist controlsend?

Just something to be aware of, depending on what you are actually trying to do, since you're talking about a Media Player program, many media player programs, will see and react to media keys regardless of if the program is active or not. So if you're trying to do something like play/pause/stop or s...
by Noesis
15 Mar 2018, 00:56
Forum: Ask For Help
Topic: @Lexikos and other experts - any idea why I need a Sleep 0 in this code to make keyboard-specific hotstrings work?
Replies: 12
Views: 1190

Re: @Lexikos and other experts - any idea why I need a Sleep 0 in this code to make keyboard-specific hotstrings work?

Ok, so you're filtering devices, I wasn't sure. However, I thought sending messages was non-blocking? Sending a Message (eg. SendMessage, SendMessageTimeout) is blocking, once the message is sent, it halts the thread waiting for a reply to be received. Posting a Message (PostMessage) on the other ha...
by Noesis
14 Mar 2018, 09:08
Forum: Ask For Help
Topic: @Lexikos and other experts - any idea why I need a Sleep 0 in this code to make keyboard-specific hotstrings work?
Replies: 12
Views: 1190

Re: @Lexikos and other experts - any idea why I need a Sleep 0 in this code to make keyboard-specific hotstrings work?

Hi again evilC, This naturally depends on exactly which filters are being set for the context used with the interception loop, But I'm assuming you're getting both down and up events, from all keyboard devices. Based on this assumption, it seems to me you are switching the ahk context to both true t...
by Noesis
14 Mar 2018, 08:02
Forum: Ask For Help
Topic: Mouseevent units question
Replies: 8
Views: 624

Re: Mouseevent units question

Fair enough, however, he's not using, Raw Input or a WACOM tablet (which btw I'm unfamiliar with), as far as I'm aware, he's using a "mouse_event" dllcall which I linked to in my original post. This particular Mouse_Event api call doesn't report anything, (it's a Void return type). It's like ahk's m...
by Noesis
14 Mar 2018, 05:55
Forum: Ask For Help
Topic: Mouseevent units question
Replies: 8
Views: 624

Re: Mouseevent units question

@evilC, I'm not entirely sure if you've posted to the correct thread. Regarding the "If absolute it's pixel based" I'd have thought that was pretty self explanatory, 1 unit = 1 pixel. Since it's a Windows API call, it means the size of the MS Windows Desktop, as represented by the monitor resolution...
by Noesis
13 Mar 2018, 00:15
Forum: Ask For Help
Topic: Mouseevent units question
Replies: 8
Views: 624

Re: Mouseevent units question

Short answer is Mouse_Event is expecting an integer value. Depending on what you're trying to do, it also kind of depends on how you're using mouse_event (are you telling it to use relative or absolute coords). If absolute it's pixel based, if relative, it's mickey based. Again, neither of these uni...
by Noesis
06 Mar 2018, 23:30
Forum: Ask For Help
Topic: How to map key1 + shift + key2 ?
Replies: 4
Views: 409

Re: How to map key1 + shift + key2 ?

With normal hotkeys a "+" would be the way to do it, however combination hotkeys (those that use "&") work differently. The reason is when you use a combo hotkey, it implicitly uses the * prefix, which ignores modifiers (so it will work with any or no modifiers (ctrl,shft,win,alt) held). So, as you ...
by Noesis
05 Mar 2018, 21:45
Forum: Ask For Help
Topic: How to map key1 + shift + key2 ?
Replies: 4
Views: 409

Re: How to map key1 + shift + key2 ?

You have a couple of options, you could use an if GetKeystate("Shift","P") within the hotkey or use a context (same condition) for the hotkey. Using context sensitive hotkeys would probably be better, just be sure the hotkey with a context is physically located before (above) the hotkey without a co...
by Noesis
01 Mar 2018, 23:22
Forum: Wish List
Topic: Remove or alter the line "SendMode Input ; Recommended for new scripts due to its superior speed and reliability"
Replies: 5
Views: 2346

Re: Remove or alter the line "SendMode Input ; Recommended for new scripts due to its superior speed and reliability"

I tend to think that a better solution to this would be a change to SetKeyDelay so the options for the last parameter could be Play|Input, instead of the current option of Play only, (and nothing being Event), and having Input mode obey the relevant settings. Not sure if that's been wished for befor...
by Noesis
26 Feb 2018, 23:23
Forum: Ask For Help
Topic: Cancelling hotkey actions
Replies: 6
Views: 723

Re: Cancelling hotkey actions

- Can this script be improved? There's a delayed reaction during the Sleep period when you press the secondary hotkey to end the script. It could, in that the delayed reaction could be reduced to anything down to about 15ms so made to look negligible, (fyi the code I submitted has the same delayed ...
by Noesis
26 Feb 2018, 01:32
Forum: Gaming
Topic: Toggle into a hold.
Replies: 2
Views: 394

Re: Toggle into a hold.

A couple of things to test, try without the blind statements, and also use a different hotkey (or alter the games key bind). I've had similar experiences in other games, where when the key being sent, and also the hotkey being used are the same key, it doesn't work (but will in normal apps). Changin...
by Noesis
24 Feb 2018, 00:50
Forum: Ask For Help
Topic: Cancelling hotkey actions
Replies: 6
Views: 723

Re: Cancelling hotkey actions

Just use a variable and check it, before executing each action: origin := [] cancel := false ;(or true, doesn't really matter here) MoveMouse(xy) { MouseMove, xy[1], xy[2], 5.0 } SetOrigin(pos:=false) { global origin, cancel if (pos) origin := pos else if (origin.Length() == 0) { cancel := false Mou...

Go to advanced search