Wenfang Du
Wenfang Du

Reputation: 11337

How to disable a hotkey only if the active window is a given size?

I want to disable Shift only if the active window is 500px wide and 300px tall, how to write such a script?

Upvotes: 0

Views: 75

Answers (1)

0x464e
0x464e

Reputation: 6489

Very easily doable with a context sensitive hotkey with #If(docs).

#If, SizeCheck()
RShift::
LShift::return
#If

SizeCheck()
{
    WinGetPos, , , width, height, A
    return width == 500 && height == 300
}

Be sure to add the * modifier(docs) as you see fit.

Upvotes: 1

Related Questions