Python pyglet.window.key.V Examples

The following are 6 code examples of pyglet.window.key.V(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pyglet.window.key , or try the search function .
Example #1
Source File: Mobius_in_H3space.py    From pywonderland with MIT License 6 votes vote down vote up
def on_key_press(self, symbol, modifiers):
        if symbol == key._1:
            self.apply = not self.apply
            with self.shader:
                self.shader.uniformi("iApply", self.apply)

        if symbol == key._2:
            self.hyperbolic = not self.hyperbolic
            with self.shader:
                self.shader.uniformi("iHyperbolic", self.hyperbolic)

        if symbol == key._3:
            self.elliptic = not self.elliptic
            with self.shader:
                self.shader.uniformi("iElliptic", self.elliptic)

        if symbol == key.V and (modifiers & key.LCTRL):
            self.switch_video()

        if symbol == key.ENTER:
            self.save_screenshot()

        if symbol == key.ESCAPE:
            pyglet.app.exit() 
Example #2
Source File: main.py    From pywonderland with MIT License 5 votes vote down vote up
def on_key_press(self, symbol, modifiers):
        """
        Keyboard interface.
        """
        if symbol == key.ENTER:
            self.save_screenshot()

        if symbol == key.ESCAPE:
            pyglet.app.exit()

        if symbol == key.SPACE:
            self.clear_blank_window()

        if symbol == key.P:
            self.use_random_palette()

        if symbol == key.S and not modifiers:
            self.use_next_species()

        if symbol == key.S and (modifiers & key.LCTRL):
            self.save_config()

        if symbol == key.O and (modifiers & key.LCTRL):
            self.require_config_input()

        if symbol == key.V and (modifiers & key.LCTRL):
            self.switch_video() 
Example #3
Source File: WINDOW_SET_VSYNC.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
def on_key_press(self, symbol, modifiers):
        if symbol == key.V:
            vsync = not self.w1.vsync
            self.w1.set_vsync(vsync)
            print 'vsync is %r' % self.w1.vsync 
Example #4
Source File: WINDOW_SET_MOUSE_VISIBLE.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
def on_key_press(self, symbol, modifiers):
        if symbol == key.V:
            visible = (modifiers & key.MOD_SHIFT)
            self.w.set_mouse_visible(visible)
            print 'Mouse is now %s' % (visible and 'visible' or 'hidden') 
Example #5
Source File: test_window_settings.py    From pyglet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def on_key_press(self, symbol, modifiers):
        if symbol == key.V:
            visible = (modifiers & key.MOD_SHIFT)
            self.w.set_mouse_visible(visible)
            print('Mouse is now %s' % (visible and 'visible' or 'hidden')) 
Example #6
Source File: test_window_settings.py    From pyglet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def on_key_press(self, symbol, modifiers):
        if symbol == key.V:
            vsync = not self.w1.vsync
            self.w1.set_vsync(vsync)
            print('vsync is %r' % self.w1.vsync)