fix keybindings
This commit is contained in:
parent
6da2cc58c0
commit
73922d537d
1 changed files with 26 additions and 25 deletions
|
|
@ -166,23 +166,25 @@ class Sync(Thread):
|
||||||
self.stop()
|
self.stop()
|
||||||
self.mpv.stop()
|
self.mpv.stop()
|
||||||
|
|
||||||
|
def is_keydown(self, args):
|
||||||
|
if args and args[0] and args[0][0] == 'd':
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def q_binding(self, *args):
|
def q_binding(self, *args):
|
||||||
if args[0] != 'd-':
|
if self.is_keydown(args):
|
||||||
return
|
|
||||||
self.stop()
|
self.stop()
|
||||||
self.mpv.stop()
|
self.mpv.stop()
|
||||||
|
|
||||||
def space_binding(self, *args):
|
def space_binding(self, *args):
|
||||||
if args[0] != 'd-':
|
if self.is_keydown(args):
|
||||||
return
|
|
||||||
if self.mpv.pause:
|
if self.mpv.pause:
|
||||||
self.p_binding(*args)
|
self.p_binding(*args)
|
||||||
else:
|
else:
|
||||||
self.s_binding(*args)
|
self.s_binding(*args)
|
||||||
|
|
||||||
def s_binding(self, *args):
|
def s_binding(self, *args):
|
||||||
if args[0] != 'd-':
|
if self.is_keydown(args):
|
||||||
return
|
|
||||||
self.is_paused = True
|
self.is_paused = True
|
||||||
self.mpv.pause = True
|
self.mpv.pause = True
|
||||||
if self.sax:
|
if self.sax:
|
||||||
|
|
@ -190,8 +192,7 @@ class Sync(Thread):
|
||||||
self.send_playback_state()
|
self.send_playback_state()
|
||||||
|
|
||||||
def p_binding(self, *args):
|
def p_binding(self, *args):
|
||||||
if args[0] != 'd-':
|
if self.is_keydown(args):
|
||||||
return
|
|
||||||
self.is_paused = False
|
self.is_paused = False
|
||||||
self._tick = 0
|
self._tick = 0
|
||||||
self.mpv.pause = False
|
self.mpv.pause = False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue