Create Input button - Raspberry Pi Forums


is there way create 'esc' button?
have switch between 3.3v , gpio17, make send signal equal escape button, can exit game...
i'm trying python-uinput far no luck, tips?

got slice of code

code: select all

import rpi.gpio gpio import uinput gpio.setmode(gpio.bcm) gpio.setup(17, gpio.in)  def main():     events = (         uinput.key_esc,              )      device = uinput.device(events)      device.emit(uinput.key_esc, 1) # press.     device.emit(uinput.key_esc, 0) # release.      while 1: 	if gpio.input(17)==true: #don't think '==true' part necessary 		main() 
switch faulty...


raspberrypi



Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums