我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用System.ConsoleKey()。
def getkeypress(self): '''Return next key press event from the queue, ignoring others.''' ck=System.ConsoleKey while 1: e = System.Console.ReadKey(True) if e.Key == System.ConsoleKey.PageDown: #PageDown self.scroll_window(12) elif e.Key == System.ConsoleKey.PageUp:#PageUp self.scroll_window(-12) elif str(e.KeyChar)=="\000":#Drop deadkeys log_sock("Deadkey: %s"%e) return event(self,e) pass else: return event(self,e)
def make_event_from_keydescr(keydescr): def input(): return 1 input.KeyChar="a" input.Key=System.ConsoleKey.A input.Modifiers=System.ConsoleModifiers.Shift input.next_serial=input e=event(input,input) del input.next_serial keyinfo=make_KeyPress_from_keydescr(keydescr) e.keyinfo=keyinfo return e
def getkeypress(self): '''Return next key press event from the queue, ignoring others.''' ck = System.ConsoleKey while 1: e = System.Console.ReadKey(True) if e.Key == System.ConsoleKey.PageDown: #PageDown self.scroll_window(12) elif e.Key == System.ConsoleKey.PageUp:#PageUp self.scroll_window(-12) elif str(e.KeyChar) == "\000":#Drop deadkeys log("Deadkey: %s"%e) return event(self, e) else: return event(self, e)
def make_event_from_keydescr(keydescr): def input(): return 1 input.KeyChar = "a" input.Key = System.ConsoleKey.A input.Modifiers = System.ConsoleModifiers.Shift input.next_serial = input e = event(input,input) del input.next_serial keyinfo = make_KeyPress_from_keydescr(keydescr) e.keyinfo = keyinfo return e
def getkeypress(self): '''Return next key press event from the queue, ignoring others.''' ck = System.ConsoleKey while 1: e = System.Console.ReadKey(True) if e.Key == System.ConsoleKey.PageDown: #PageDown self.scroll_window(12) elif e.Key == System.ConsoleKey.PageUp: #PageUp self.scroll_window(-12) elif str(e.KeyChar) == "\000": #Drop deadkeys log("Deadkey: %s" % e) return event(self, e) else: return event(self, e)
def make_event_from_keydescr(keydescr): def input(): return 1 input.KeyChar = "a" input.Key = System.ConsoleKey.A input.Modifiers = System.ConsoleModifiers.Shift input.next_serial = input e = event(input, input) del input.next_serial keyinfo = make_KeyPress_from_keydescr(keydescr) e.keyinfo = keyinfo return e
def make_event_from_keydescr(keydescr): def input(): return 1 input.KeyChar = u"a" input.Key = System.ConsoleKey.A input.Modifiers = System.ConsoleModifiers.Shift input.next_serial = input e = event(input,input) del input.next_serial keyinfo = make_KeyPress_from_keydescr(keydescr) e.keyinfo = keyinfo return e
def getkeypress(self): u'''Return next key press event from the queue, ignoring others.''' ck = System.ConsoleKey while 1: e = System.Console.ReadKey(True) if e.Key == System.ConsoleKey.PageDown: #PageDown self.scroll_window(12) elif e.Key == System.ConsoleKey.PageUp:#PageUp self.scroll_window(-12) elif str(e.KeyChar) == u"\000":#Drop deadkeys log(u"Deadkey: %s"%e) return event(self, e) else: return event(self, e)