External Exam Download Resources Web Applications Games Recycle Bin

Rickrolling on Keydown key "A"

import ctypes #access Windows C functions
kernel32 = ctypes.windll.kernel32 #kernel level
user32 = ctypes.windll.user32  #user level

user32.ShowWindow(kernel32.GetConsoleWindow(), True) #showing console.. for now

key_pressed = user32.GetAsyncKeyState

import webbrowser #https://docs.python.org/3/library/webbrowser.html

while True:
  if( key_pressed(65) & 1 ): #if A pressed:
    webbrowser.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    ## ^^ Rick Rolled