diff options
author | Nat <Nat@localhost.localdomain> | 2007-02-02 02:07:04 (GMT) |
---|---|---|
committer | Nat <Nat@localhost.localdomain> | 2007-02-02 02:07:04 (GMT) |
commit | 5b4df75fbac9794d85e56a03c51ebb95ef0e7e37 (patch) | |
tree | bb4f35392f2f6768fd11e2afd8e30b7c3b73659e | |
parent | 7ef8344d8331781d3a7a3f516e3a33aaa389276b (diff) |
Space bar play pause (needs work)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Player/StandalonePlayer.py | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -1,2 +1,3 @@ *pyc *~ +*.kpf diff --git a/Player/StandalonePlayer.py b/Player/StandalonePlayer.py index aaf3e35..4957b2a 100644 --- a/Player/StandalonePlayer.py +++ b/Player/StandalonePlayer.py @@ -65,6 +65,7 @@ class StandAlonePlayer( gtk.EventBox ): self.add(self.mainWindowBox) self.enableKeyboard() + self.connect('key-press-event',self.handleKeyboard) self.setInstrument(self.instrument) self.drawInstrumentButtons() @@ -439,6 +440,13 @@ class StandAlonePlayer( gtk.EventBox ): instrumentFlag = instrument, reverbSend = 0) note.playNow(secs_per_tick) + + def handleKeyboard(self, widget, event): + if event.hardware_keycode == 65: + if self.playStopButton.get_active(): + self.playStopButton.set_active(False) + else: + self.playStopButton.set_active(True) def playStartupSound(self): r = str(random.randrange(1,11)) |