Jump to content

Is it possible to make autohotkey send a key press "L" to a application in the background while I'am in fullscreen in a game without it affecting the game in focus? 

AMD Ryzen 9950X3D [x2 360 Rad EKWB] | Asus Extreme x670E | RTX STRIX 5090 OC@3GHz [Alpha Block] | Corsair HX1500i | G.Skill Neo CL30 6000MHz (2x32GB) | Samsung 9100PRO 8TB Gen5 + MP700 2TB Gen5 + 980/950 Pro 1TB M.2 | x6 85PRO 512GB | NAS@10Gbit/s 4x 24TB Seagate Exo Raid 10 (2x 1TB raid 1 NVME Cache) - 4x 1TB NVMe Raid 0 + Backblaze | Lian-Li o11D XL | Main Screen: Samsung OLED G9 | AUX: LG IPS7 27" (x2) LG CX 55" G-Sync | 10Gbit/s ISP connection | Copyright©1996-2026 Teletha All rights reserved. ®

Link to comment
https://linustechtips.com/topic/1394904-autohotkey-simple-script-question/
Share on other sites

Link to post
Share on other sites

https://www.autohotkey.com/docs/commands/ControlSend.htm

This apparently should do it. But do consider that you may need to add other commands to remove your active window from receiving same press. What are you trying to achieve with this?

^^^^ That's my post ^^^^
<-- This is me --- That's your scrollbar -->
vvvv Who's there? vvvv

Link to post
Share on other sites

You probably need "ControlSend": https://www.autohotkey.com/docs/commands/ControlSend.htm

I can open a new window and press a letter, but I can't figure out how to make it press a letter inside an already existing window.

 

F23::
	Run, Notepad,, Min, PID
	WinWait, ahk_pid %PID%
	ControlSend,, L

For example, this opens a new Notepad window in the background and press the letter L. The issue is that it keeps opening new windows, but maybe you can figure out how to make it detect an existing window. 

 

Keep in mind particularly games apparently don't like Autohotkey, so use at your own risk.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×