def on_key_press_event(self, actor, event): #actor = stage.get_actor_at_pos(clutter.PICK_ALL, int(event.x), int(event.y)) if event.keyval == clutter.keysyms.Home: self.graphview.reset() if event.keyval == clutter.keysyms.Escape: clutter.main_quit() return True
def parseKeyPress(self, actor, event): # do stuff when the user presses a key # it would be awesome if I could find some documentation regarding clutter.keysyms if event.keyval in [clutter.keysyms.q, clutter.keysyms.Escape]: # if the user pressed "q" quit the test clutter.main_quit() elif event.keyval == clutter.keysyms.s: # if the user pressed "s" swap the labels self.swapLabels()
def parseKeyPress(self, actor, event): #do stuff when the user presses a key #it would be awesome if I could find some documentation regarding clutter.keysyms if event.keyval == clutter.keysyms.q: #if the user pressed "q" quit the test clutter.main_quit() elif event.keyval == clutter.keysyms.s: #if the user pressed "s" swap the labels self.swapLabels()
def quit(self, *args): log.info("Exiting...") self.updater.stop() self.photo_pool.stop() self.updater.join() self.photo_pool.join() clutter.main_quit()
def on_key_press (self, stage, event): if event.keyval == clutter.keysyms.q: clutter.main_quit() return True if event.keyval == clutter.keysyms.r: for hand in self: hand.show() return True return False
def on_key_press( self, stage, event ): if event.keyval == gtk.keysyms.Page_Up: self.scroll( 200 ) elif event.keyval == gtk.keysyms.Page_Down: self.scroll( -200 ) elif event.keyval == gtk.keysyms.Up: self.scroll( 5 ) elif event.keyval == gtk.keysyms.Down: self.scroll( -5 ) elif event.keyval == gtk.keysyms.Escape: clutter.main_quit() return True
def key_press(self, stage, event): """Handle key presses.""" if event.keyval == clutter.keysyms.q: #if the user pressed "q" quit the demo clutter.main_quit() if event.keyval in (clutter.keysyms.plus, clutter.keysyms.o): #if the user pressed "+" zoom in self.actor.zoom_in() if event.keyval in (clutter.keysyms.minus, clutter.keysyms.i): #if the user pressed "-" zoom out self.actor.zoom_out() elif event.keyval == clutter.keysyms.a: #if the user pressed "a" turn people into ants. OMG! for marker in self.markers: marker.toggle_ant() print event.keyval
def OnKeyPressEvent(stage, event, show): """Handle Keypress Events. Args: event: (clutter event) keypress event show: (Slider) Slideshow instance """ logging.debug('Got keypress %s' % event.keyval) # Handle `q` if (event.keyval == 113): clutter.main_quit() sys.exit(0) elif (event.keyval == 65363): if FLAGS.manualadvance: logging.debug('Got arrow key, nexting?') show.next() else: logging.debug('Got arrow key, manual advance disabled')
def parseKeyPress(self, stage, event): #do stuff when the user presses a key if event.keyval == clutter.keysyms.q: #if the user pressed "q" quit the app clutter.main_quit() elif event.keyval == clutter.keysyms.Down: #if the user pressed Down arrow - get an older entry self.entry+=1 if (self.entry > len(self.feed.entries)): self.entry-=1 else: self.flipfeed() elif event.keyval == clutter.keysyms.Up: #if the user pressed Up arrow - get a more recent entry self.entry -=1 if (self.entry < 0): self.entry =0 else: self.flipfeed()
def do_standalone_display(self): """This might be useful somewhere. (no resize)""" stage = clutter.Stage() stage.connect('destroy', clutter.main_quit) stage.connect('key-press-event', lambda x,y: clutter.main_quit()) stage.set_fullscreen(True) stage.set_color(clutter.color_from_string('black')) stage.add(self.group) stage.show_all() clutter.main()
def on_press(self, actor, event): """ Toplevel callback for when buttons are pressed. """ if event.keyval == clutter.keysyms.Escape: logging.info('Escape button pressed. Quitting jukebox.') clutter.main_quit() elif event.keyval == clutter.keysyms.space: logging.debug('Space button pressed which means credit insert.') logging.info('Reading new credits value.') credits_load() self.screen_container.update_screens() elif event.keyval == clutter.keysyms.BackSpace: logging.info('Showing now playing information.') self.footer.display() elif event.keyval == clutter.keysyms.f: logging.info('Toggling fullscreen.') self.stage.set_fullscreen(not stage.get_fullscreen()) self.screen_container.on_press(actor, event)
def parseKeyPress(self, stage, event): #do stuff when the user presses a key if event.keyval == clutter.keysyms.q: #if the user pressed "q" quit the app clutter.main_quit() elif event.keyval == clutter.keysyms.Down: #if the user pressed Down arrow - get an older entry self.entry += 1 if (self.entry > len(self.feed.entries)): self.entry -= 1 else: self.flipfeed() elif event.keyval == clutter.keysyms.Up: #if the user pressed Up arrow - get a more recent entry self.entry -= 1 if (self.entry < 0): self.entry = 0 else: self.flipfeed()
def on_button_press_event (stage, event): clutter.main_quit()
def on_press(self, actor, event): """ """ if event.keyval == clutter.keysyms.Escape: clutter.main_quit()
def shortcuts( self, stage, event ): if event.keyval == clutter.keysyms.Escape: clutter.main_quit()
def close(self): canbus.close() clutter.main_quit()
def delete_event(self, event, data=None): clutter.main_quit()
def on_press(self, actor, event): """ """ if event.keyval == clutter.keysyms.Escape: clutter.main_quit() elif event.keyval == clutter.keysyms.a: # player A rings in. game_buttons.player_set(0, True) game.buzz(0) self.update() elif event.keyval == clutter.keysyms.b: # player B rings in. game_buttons.player_set(1, True) game.buzz(1) self.update() elif event.keyval == clutter.keysyms.c: # player C rings in. game_buttons.player_set(2, True) game.buzz(2) self.update() elif event.keyval == clutter.keysyms.space: if not self.final_round_overlay.is_playing(): # We do not allow for incoming space button presses when final # round overlay music is playing. # multi-purpose bar press game.bar() self.update() elif event.keyval == clutter.keysyms.x: # cancel game.cancel() self.update() elif event.keyval == clutter.keysyms.y: # correct answer game.correct_answer() self.update() elif event.keyval == clutter.keysyms.n: # incorrect answer game.incorrect_answer() self.update() elif event.keyval == clutter.keysyms.z: logging.debug('resetting player lights') game_buttons.reset_player_lights() elif event.keyval == clutter.keysyms.l: if self.category_overlay in self.get_children(): self.category_overlay.animate(clutter.LINEAR, 500, 'x', self.category_overlay.get_x() - self.get_width()) else: self.category_overlay.set_size(self.get_width(), self.get_height()) self.category_overlay.set_x(self.get_width()) self.add(self.category_overlay) self.category_overlay.animate(clutter.LINEAR, 500, 'x', self.category_overlay.get_x() - self.get_width()) elif event.keyval == clutter.keysyms.p: # DEBUG - for testing end of round condition without clicking everything. # don't leave this active in production code! for category in game.categories: for clue in category.clues: clue.state = 'selected' game.categories[0].clues[0].state = 'unanswered' elif event.keyval == clutter.keysyms.f: # Fullscreen play area. self.set_fullscreen(not self.get_fullscreen()) elif event.keyval == clutter.keysyms.s: self.flash_scores()
def do_quit (self, *args): print "quitting" clutter.main_quit()
def on_key_press (stage, event): if event.keyval == clutter.keysyms.q: clutter.main_quit() return True return False
def quit(self, *args): print "Exiting..." clutter.main_quit()
def on_key_press_event(stage, event): if (event.keyval == 113): clutter.main_quit()
def on_button_press_event(stage, event): print str(event) stage.foreach(actor_foreach, 'hello') clutter.main_quit()
def on_press(self, actor, event): """ """ if event.keyval == clutter.keysyms.Escape: clutter.main_quit() elif event.keyval == clutter.keysyms.a: # player A rings in. game_buttons.player_set(0, True) game.buzz(0) self.update() elif event.keyval == clutter.keysyms.b: # player B rings in. game_buttons.player_set(1, True) game.buzz(1) self.update() elif event.keyval == clutter.keysyms.c: # player C rings in. game_buttons.player_set(2, True) game.buzz(2) self.update() elif event.keyval == clutter.keysyms.space: if not self.final_round_overlay.is_playing(): # We do not allow for incoming space button presses when final # round overlay music is playing. # multi-purpose bar press game.bar() self.update() elif event.keyval == clutter.keysyms.x: # cancel game.cancel() self.update() elif event.keyval == clutter.keysyms.y: # correct answer game.correct_answer() self.update() elif event.keyval == clutter.keysyms.n: # incorrect answer game.incorrect_answer() self.update() elif event.keyval == clutter.keysyms.z: logging.debug('resetting player lights') game_buttons.reset_player_lights() elif event.keyval == clutter.keysyms.l: if self.category_overlay in self.get_children(): self.category_overlay.animate( clutter.LINEAR, 500, 'x', self.category_overlay.get_x() - self.get_width()) else: self.category_overlay.set_size(self.get_width(), self.get_height()) self.category_overlay.set_x(self.get_width()) self.add(self.category_overlay) self.category_overlay.animate( clutter.LINEAR, 500, 'x', self.category_overlay.get_x() - self.get_width()) elif event.keyval == clutter.keysyms.p: # DEBUG - for testing end of round condition without clicking everything. # don't leave this active in production code! for category in game.categories: for clue in category.clues: clue.state = 'selected' game.categories[0].clues[0].state = 'unanswered' elif event.keyval == clutter.keysyms.f: # Fullscreen play area. self.set_fullscreen(not self.get_fullscreen()) elif event.keyval == clutter.keysyms.s: self.flash_scores()
def do_quit(self, *args): print "quitting" clutter.main_quit()
def shutdown_gui(self): print "shutdown_gui" clutter.main_quit()
def on_button_press_event(stage, event): clutter.main_quit()
def quit(self): # Import clutter only in the gobject thread import clutter clutter.main_quit()
def parseKeyPress(self, event): if event.keyval == clutter.keysyms.Escape: clutter.main_quit() elif event.keyval == clutter.keysyms.F11: stage.set_fullscreen(not stage.get_fullscreen())
def input_keys(self, arg2, arg3): print "Input width (zero to quit): ", width = input() if width == 0: clutter.main_quit() return print "Input height (zero to quit): ", height = input() if height == 0: clutter.main_quit() return print "Input x coordinate (0 to quit): ", x = input() if x == 0: clutter.main_quit() return while abs(x) > self.x: if x < 0: x +=self.x else: x -= self.x if x < 0: x = self.x - x print "Input y coordinate (0 to quit): ", y = input() if y == 0: clutter.main_quit() return while abs(y) > self.y: if y < 0: y +=self.y else: y -= self.y if y < 0: y = self.y - y print "Input colour in hexidecimal ('quit' to quit): #", color = "#" + raw_input() if color == "#quit": clutter.main_quit() return print "Enter a border width (0 to quit, negative for no border): ", border = input() if border == 0: clutter.main_quit() return has_border = False if border > 0: has_border = True if has_border: print "Enter the border colour ('quit' to quit): #", border_color = "#" + raw_input() if border_color == "#quit": clutter.main_quit() return print "Adding rectangle:" print "Width: " + str(width) + ", Height: " + str(height) print "Position: (" + str(x) + ", " + str(y) + ")" print "Colour: " + color if has_border: print "Border: Width: " + str(border) + ", Colour: " + border_color self.add_rectangle((x, y), (width, height), color, border, border_color) else: self.add_rectangle((x, y), (width, height), color) return
def on_button_press_event (stage, event): print str(event) stage.foreach(actor_foreach, 'hello') clutter.main_quit()