|
30 | 30 | setattr(thismodule, '_' + shortName, qtCode) |
31 | 31 | setattr(thismodule, '_' + shortName.upper(), enum_as_int(Qt.ShiftModifier) | qtCode) |
32 | 32 |
|
33 | | -def kode(comb): |
| 33 | + |
| 34 | +def key_code(comb): |
34 | 35 | try: |
35 | 36 | return comb.toCombined() |
36 | 37 | except AttributeError: |
37 | 38 | return enum_as_int(comb) |
38 | 39 |
|
39 | | -_0 = kode(Qt.Key_0) |
40 | | -_Dollar = kode(Qt.ShiftModifier | Qt.Key_Dollar) |
41 | | -_Percent = kode(Qt.ShiftModifier | Qt.Key_Percent) |
42 | | -_Caret = kode(Qt.ShiftModifier | Qt.Key_AsciiCircum) |
43 | | -_Esc = kode(Qt.Key_Escape) |
44 | | -_Insert = kode(Qt.Key_Insert) |
45 | | -_Down = kode(Qt.Key_Down) |
46 | | -_Up = kode(Qt.Key_Up) |
47 | | -_Left = kode(Qt.Key_Left) |
48 | | -_Right = kode(Qt.Key_Right) |
49 | | -_Space = kode(Qt.Key_Space) |
50 | | -_BackSpace = kode(Qt.Key_Backspace) |
51 | | -_Equal = kode(Qt.Key_Equal) |
52 | | -_Less = kode(Qt.ShiftModifier | Qt.Key_Less) |
53 | | -_Greater = kode(Qt.ShiftModifier | Qt.Key_Greater) |
54 | | -_Home = kode(Qt.Key_Home) |
55 | | -_End = kode(Qt.Key_End) |
56 | | -_PageDown = kode(Qt.Key_PageDown) |
57 | | -_PageUp = kode(Qt.Key_PageUp) |
58 | | -_Period = kode(Qt.Key_Period) |
59 | | -_Enter = kode(Qt.Key_Enter) |
60 | | -_Return = kode(Qt.Key_Return) |
| 40 | + |
| 41 | +_0 = key_code(Qt.Key_0) |
| 42 | +_Dollar = key_code(Qt.ShiftModifier | Qt.Key_Dollar) |
| 43 | +_Percent = key_code(Qt.ShiftModifier | Qt.Key_Percent) |
| 44 | +_Caret = key_code(Qt.ShiftModifier | Qt.Key_AsciiCircum) |
| 45 | +_Esc = key_code(Qt.Key_Escape) |
| 46 | +_Insert = key_code(Qt.Key_Insert) |
| 47 | +_Down = key_code(Qt.Key_Down) |
| 48 | +_Up = key_code(Qt.Key_Up) |
| 49 | +_Left = key_code(Qt.Key_Left) |
| 50 | +_Right = key_code(Qt.Key_Right) |
| 51 | +_Space = key_code(Qt.Key_Space) |
| 52 | +_BackSpace = key_code(Qt.Key_Backspace) |
| 53 | +_Equal = key_code(Qt.Key_Equal) |
| 54 | +_Less = key_code(Qt.ShiftModifier | Qt.Key_Less) |
| 55 | +_Greater = key_code(Qt.ShiftModifier | Qt.Key_Greater) |
| 56 | +_Home = key_code(Qt.Key_Home) |
| 57 | +_End = key_code(Qt.Key_End) |
| 58 | +_PageDown = key_code(Qt.Key_PageDown) |
| 59 | +_PageUp = key_code(Qt.Key_PageUp) |
| 60 | +_Period = key_code(Qt.Key_Period) |
| 61 | +_Enter = key_code(Qt.Key_Enter) |
| 62 | +_Return = key_code(Qt.Key_Return) |
61 | 63 |
|
62 | 64 |
|
63 | 65 | def code(ev): |
|
0 commit comments