Changeset View
Changeset View
Standalone View
Standalone View
tools/selection/kpAbstractSelectionTool_KeyboardEvents.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | 43 | | |||
44 | //--------------------------------------------------------------------- | 44 | //--------------------------------------------------------------------- | ||
45 | 45 | | |||
46 | // protected virtual [base kpTool] | 46 | // protected virtual [base kpTool] | ||
47 | void kpAbstractSelectionTool::keyPressEvent (QKeyEvent *e) | 47 | void kpAbstractSelectionTool::keyPressEvent (QKeyEvent *e) | ||
48 | { | 48 | { | ||
49 | #if DEBUG_KP_TOOL_SELECTION && 0 | 49 | #if DEBUG_KP_TOOL_SELECTION && 0 | ||
50 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::keyPressEvent(e->text='" | 50 | qCDebug(kpLogTools) << "kpAbstractSelectionTool::keyPressEvent(e->text='" | ||
51 | << e->text () << "')" << endl; | 51 | << e->text () << "')"; | ||
52 | #endif | 52 | #endif | ||
53 | 53 | | |||
54 | e->ignore (); | 54 | e->ignore (); | ||
55 | 55 | | |||
56 | if (document ()->selection () && | 56 | if (document ()->selection () && | ||
57 | !hasBegunDraw () && | 57 | !hasBegunDraw () && | ||
58 | e->key () == Qt::Key_Escape) | 58 | e->key () == Qt::Key_Escape) | ||
59 | { | 59 | { | ||
60 | #if DEBUG_KP_TOOL_SELECTION && 0 | 60 | #if DEBUG_KP_TOOL_SELECTION && 0 | ||
61 | qCDebug(kpLogTools) << "\tescape pressed with sel when not begun draw - deselecting" | 61 | qCDebug(kpLogTools) << "\tescape pressed with sel when not begun draw - deselecting"; | ||
62 | << endl; | | |||
63 | #endif | 62 | #endif | ||
64 | 63 | | |||
65 | pushOntoDocument (); | 64 | pushOntoDocument (); | ||
66 | e->accept (); | 65 | e->accept (); | ||
67 | } | 66 | } | ||
68 | else | 67 | else | ||
69 | { | 68 | { | ||
70 | #if DEBUG_KP_TOOL_SELECTION && 0 | 69 | #if DEBUG_KP_TOOL_SELECTION && 0 | ||
71 | qCDebug(kpLogTools) << "\tkey processing did not accept (text was '" | 70 | qCDebug(kpLogTools) << "\tkey processing did not accept (text was '" | ||
72 | << e->text () | 71 | << e->text () | ||
73 | << "') - passing on event to kpTool" | 72 | << "') - passing on event to kpTool"; | ||
74 | << endl; | | |||
75 | #endif | 73 | #endif | ||
76 | 74 | | |||
77 | if ( document()->selection() && !hasBegunDraw() && | 75 | if ( document()->selection() && !hasBegunDraw() && | ||
78 | ((e->key() == Qt::Key_Left) || | 76 | ((e->key() == Qt::Key_Left) || | ||
79 | (e->key() == Qt::Key_Right) || | 77 | (e->key() == Qt::Key_Right) || | ||
80 | (e->key() == Qt::Key_Up) || | 78 | (e->key() == Qt::Key_Up) || | ||
81 | (e->key() == Qt::Key_Down)) ) | 79 | (e->key() == Qt::Key_Down)) ) | ||
82 | { | 80 | { | ||
Show All 22 Lines |