diff --git a/gpiopad.py b/gpiopad.py index cbfbe1d..8ca60ac 100644 --- a/gpiopad.py +++ b/gpiopad.py @@ -80,13 +80,12 @@ while True: if p1_select and GPIO.input(P1_BTN_SELECT): # select button released p1_select = False device_p1.emit(uinput.BTN_SELECT, 0) - # if (not p1_mode) and (not GPIO.input(P1_BTN_MODE)): # select button pressed - # p1_mode = True - # device_p1.emit(uinput.BTN_MODE, 0) - # if p1_mode and GPIO.input(P1_BTN_SELECT): # select button released - # p1_mode = False - # device_p1.emit(uinput.BTN_MODE, 1) - # Later implementation + if (not p1_mode) and (not GPIO.input(P1_BTN_MODE)): # guide button pressed + p1_mode = True + device_p1.emit(uinput.BTN_MODE, 1) + if p1_mode and GPIO.input(P1_BTN_MODE): # guide button released + p1_mode = False + device_p1.emit(uinput.BTN_MODE, 0) if (not p1_fire1) and (not GPIO.input(P1_BTN_FIRE1)): # Fire1 button pressed p1_fire1 = True device_p1.emit(uinput.BTN_SOUTH, 1)