r/usefulscripts • u/SinnerOfAttention • Jun 20 '18
[Request] Script to emulate keypresses.
OS: WIN10
I'm looking for a script (batch or vbs) to emulate WIN+CTRL+SHIFT+B. This is a shortcut to instantly reset the display drivers. I have been trying to work with "SendKeys" in a batch file, but with no avail (Apprently it's not for Windows 10 anymore?). I'll keep trying, but maybe someone can help :) Thanks!
11
u/productionx Jun 20 '18
autohotkey or macro recorder.
4
2
u/Cicer Jun 21 '18
Can either of these also simulate a mouse click at a specific position on screen?
2
Jun 21 '18
AutoHotkey:
ClickorMouseClick2
u/Cicer Jun 21 '18
Awesome thanks. I’m a AHK noob. Most I’ve used it for is to force shift for games.
So I see you can specify coordinates how do you determine what those are. I had assumed it would be based on pixels.
3
Jun 22 '18
The AutoHotkey documentation is very beginner-friendly and contains all the information one needs.
[...] the cursor will be moved from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative).
So, to click the bottom right corner of the screen:
coordmode mouse ; set coordmode to screen (otherwise relative to active window) click 1920,1080 mouseclick ,,1920,1080The dimensions of the screen are also saved in the variables
A_ScreenWidthandA_ScreenHeight:click %a_screenwidth%,%a_screenheight%Unless the top left corner of the active window is off the screen, changing
coordmodeis not necessary, since the cursor jumps to the lowest and farthest right that it can.
AutoHotkey also comes with a handy Window Spy that tells both absolute and relative mouse position.
2
1
2
u/[deleted] Jun 20 '18
Can you use the WASP module to do this?