101 @property |
101 @property |
102 def cursor(self): |
102 def cursor(self): |
103 if self._cursor is not None: |
103 if self._cursor is not None: |
104 return Point(self._cursor) |
104 return Point(self._cursor) |
105 |
105 |
106 ## input events ## |
106 ## events ## |
107 |
107 |
108 def keypress(self, keyname, char, mod): |
108 def resize_event(self, ev): |
|
109 self.resize(ev.w, ev.h) |
|
110 |
|
111 def keypress_event(self, ev): |
109 """Keypress event handler. |
112 """Keypress event handler. |
110 |
113 |
111 Override to accept keyboard input. |
114 Override to accept keyboard input. |
112 |
115 |
113 Returns True if event was consumed. |
116 Returns True if event was consumed. |
114 |
117 |
115 Call this implementation from inherited classes |
118 Call this implementation from inherited classes |
116 if it does not consume the event. |
119 if it does not consume the event. |
117 |
120 |
118 """ |
121 """ |
119 if self.sig_keypress(keyname, char, mod): |
122 if self.sig_keypress(ev): |
120 return True |
123 return True |
121 self.log.debug('Not consumed: keypress(%r, %r, %r)', keyname, char, mod) |
124 self.log.debug('Not consumed: %s', ev) |
122 |
125 |
123 ## timeouts ## |
126 ## timeouts ## |
124 |
127 |
125 def add_timeout(self, delay, callback, *args): |
128 def add_timeout(self, delay, callback, *args): |
126 """Register `callback` to be called after `delay` seconds.""" |
129 """Register `callback` to be called after `delay` seconds.""" |