I want to create a program which alt tabs into for example discord, and enters a message to a user.
import time
from pynput.keyboard import Key, Controller
keyboard=Controller()
keyboard.press(Key.alt_l)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.release(Key.alt_l)
time.sleep(1)
keyboard.type('this is a test message.')
keyboard.press(Key.enter)
That's what I have currently to simulate alt tabbing, however is it possible to alt tab into a specific program?