@@ -52,7 +52,6 @@ def __getattr__(self, attr):
52
52
TIME_STEP = 0.008
53
53
54
54
test_button_layout = [
55
- # dotdict({ 'x':0, 'y':0, 'width':2, 'height':1, 'text':"Power", 'code':"Phillips-HTS KEY_POWER KEY_POWER KEY_POWER;RM-ED050-12 KEY_POWER" }),
56
55
dotdict ({ 'x' :0 , 'y' :0 , 'width' :2 , 'height' :1 , 'text' :"Power" , 'code' :"Phillips-HTS KEY_POWER;RM-ED050-12 KEY_POWER;Phillips-HTS KEY_POWER" }),
57
56
dotdict ({ 'x' :0 , 'y' :1 , 'width' :0.5 , 'height' :1 , 'text' :"Vol +" , 'code' :"Phillips-HTS KEY_VOLUMEUP" }),
58
57
dotdict ({ 'x' :0 , 'y' :2 , 'width' :0.5 , 'height' :1 , 'text' :"Vol -" , 'code' :"Phillips-HTS KEY_VOLUMEDOWN" }),
@@ -229,7 +228,6 @@ def run(self):
229
228
Style .BORDER_WIDTH : 1 , Style .TEXT_COLOUR : (255 , 255 , 255 ), Style .HIGHLIGHT_COLOUR : (0 , 255 , 0 ) })
230
229
231
230
self .layout_buttons (test_button_layout )
232
- # self.init_gpio_interrupt_buttons(gpio_buttons)
233
231
self .init_gpio_buttons (gpio_buttons )
234
232
self .init_i2c_buttons (i2c_buttons )
235
233
@@ -296,20 +294,14 @@ def run(self):
296
294
297
295
event = pygame .event .poll ()
298
296
299
- if self .current_button and time .time () - self .press_time > BUTTON_TIMEOUT :
300
- self .release_current_button ()
301
-
302
297
self .screen_saver_count -= TIME_STEP
303
298
304
299
if self .screen_saver_count <= 0 and not self .screen_saver :
305
300
self .enable_screen_saver ()
306
301
307
302
if not waiting_for_input :
308
303
self .update_display ()
309
- pygame .event .set_blocked ([pygame .MOUSEBUTTONDOWN , pygame .MOUSEBUTTONUP , pygame .MOUSEMOTION ])
310
304
self .send_ir (self .current_ir_code )
311
- time .sleep (0.1 )
312
- pygame .event .set_allowed ([pygame .MOUSEBUTTONDOWN , pygame .MOUSEBUTTONUP , pygame .MOUSEMOTION ])
313
305
314
306
self .backlight .set (False )
315
307
I2C .deinit ()
0 commit comments