Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

# -*- coding: UTF-8 -*- 

# Copyright 2009-2014 Luc Saffre 

# License: BSD (see file COPYING for details) 

 

 

""" 

This defines the :class:`Hotkey` class and some keystrokes. 

 

The system is not yet heavily used. 

 

""" 

from builtins import object 

 

 

class Hotkey(object): 

    "Represents a combination of keystrokes." 

    keycode = None 

    shift = False 

    ctrl = False 

    alt = False 

    inheritable = ('keycode', 'shift', 'ctrl', 'alt') 

 

    def __init__(self, **kw): 

        for k, v in list(kw.items()): 

            setattr(self, k, v) 

 

    def __call__(self, **kw): 

        for n in self.inheritable: 

            if not n in kw: 

                kw[n] = getattr(self, n) 

            return Hotkey(**kw) 

 

# ExtJS src/core/EventManager-more.js 

RETURN = Hotkey(keycode=13) 

ESCAPE = Hotkey(keycode=27) 

PAGE_UP = Hotkey(keycode=33) 

PAGE_DOWN = Hotkey(keycode=34) 

INSERT = Hotkey(keycode=44) 

DELETE = Hotkey(keycode=46)