Remove one of the ugly RPi touch screen workarounds
This commit is contained in:
parent
e0a9074670
commit
6a23615f87
24
clock.py
24
clock.py
|
@ -979,21 +979,19 @@ class MyClockWidget(FloatLayout):
|
|||
if len(self.light_button_move_init) == 0:
|
||||
self.light_button_move_init = touch_curr.spos
|
||||
|
||||
# Ugly workaround for issue with Kivy and Raspberry Pi 3 + touch screen: ignore corrected touched
|
||||
if touch_curr.corrected == False:
|
||||
d = touch_curr.spos[0] - self.light_button_move_init[0]
|
||||
threshold = 0.05
|
||||
d = touch_curr.spos[0] - self.light_button_move_init[0]
|
||||
threshold = 0.05
|
||||
|
||||
# Ugly workaround for issue with Kivy and Raspberry Pi 3 + touch screen: mirror d if position is on other side
|
||||
if self.light_button_move_init[0] > 0.5:
|
||||
d = -d
|
||||
# Ugly workaround for issue with Kivy and Raspberry Pi 3 + touch screen: mirror d if position is on other side
|
||||
if self.light_button_move_init[0] > 0.5:
|
||||
d = -d
|
||||
|
||||
if d > 0.05:
|
||||
# move to the right: set light to wake up level
|
||||
self.light_state = "on"
|
||||
elif d < -0.05:
|
||||
# move to the left: set light off
|
||||
self.light_state = "off"
|
||||
if d > 0.05:
|
||||
# move to the right: set light to wake up level
|
||||
self.light_state = "on"
|
||||
elif d < -0.05:
|
||||
# move to the left: set light off
|
||||
self.light_state = "off"
|
||||
|
||||
super(MyClockWidget, self).on_touch_move(touch)
|
||||
|
||||
|
|
Loading…
Reference in New Issue