/[circus]/circus/modules/CircusKeybindings/keybindings.py
ViewVC logotype

Diff of /circus/modules/CircusKeybindings/keybindings.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by tvon, Sun Nov 17 17:42:21 2002 UTC revision 1.10 by tvon, Mon Nov 18 04:04:51 2002 UTC
# Line 22  from Xlib import X, XK Line 22  from Xlib import X, XK
22  from Xlib.protocol import event  from Xlib.protocol import event
23  from circus import module  from circus import module
24  from util import KeyBinding  from util import KeyBinding
 from CircusExample import example  
25    
26  class MyModule(module.Module):  class MyModule(module.Module):
27    
# Line 33  class MyModule(module.Module): Line 32  class MyModule(module.Module):
32      def load(self):      def load(self):
33          #foo = KeyBinding(XK.string_to_keysym("F"))          #foo = KeyBinding(XK.string_to_keysym("F"))
34          foo = KeyBinding(XK.XK_Alt_L)          foo = KeyBinding(XK.XK_Alt_L)
         foo.action = example.MyModule().test  
35          self.keys.append(foo)          self.keys.append(foo)
36    
37      def handle_event(self,event):      def handle_event(self,event):
# Line 50  class MyModule(module.Module): Line 48  class MyModule(module.Module):
48                    
49    
50      def key_press(self, event):      def key_press(self, event):
   
           
51                    
52          keysym = self.display.keycode_to_keysym(event.detail, event.state)          keysym = self.display.keycode_to_keysym(event.detail, event.state)
53    
54          for i in range(len(self.keys)):          for i in range(len(self.keys)):
55              if self.keys[i].keysym == keysym:              if self.keys[i].keysym == keysym:
56                  sys.stderr.write("Keymatch\n")                  sys.stderr.write("Keymatch\n")
57                  self.keys[i].action()                  self.wm_actions.call_action('exec', "/usr/bin/rxvt", "-fg", "red")
58                    
59                    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26