diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp index e307bb89a..9b1657706 100644 --- a/src/gui/frame.cpp +++ b/src/gui/frame.cpp @@ -463,7 +463,7 @@ int Frame::get_action(int x, int y) (x < cpos->x2) && (y >= pos->y1+this->border_width.b) && (y < cpos->y1)) - || (key_shifts & KB_ALT_FLAG))) { + || (key[KEY_ALT]))) { action = WINDOW_MOVE; } /* resize */ diff --git a/src/gui/jmessage.cpp b/src/gui/jmessage.cpp index 032c545a8..bd597b224 100644 --- a/src/gui/jmessage.cpp +++ b/src/gui/jmessage.cpp @@ -32,16 +32,17 @@ JMessage jmessage_new(int type) msg->type = type; msg->any.widgets = jlist_new(); - msg->any.shifts = key_shifts & (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG); + msg->any.shifts = + (key[KEY_LSHIFT] || key[KEY_RSHIFT] ? KB_SHIFT_FLAG: 0) | + (key[KEY_LCONTROL] || key[KEY_RCONTROL] ? KB_CTRL_FLAG: 0) | + (key[KEY_ALT] ? KB_ALT_FLAG: 0); -/* printf("type=%02d ", type); */ -/* if (key_shifts & KB_SHIFT_FLAG) */ -/* printf("KB_SHIFT_FLAG "); */ -/* if (key_shifts & KB_CTRL_FLAG) */ -/* printf("KB_CTRL_FLAG "); */ -/* if (key_shifts & KB_ALT_FLAG) */ -/* printf("KB_ALT_FLAG "); */ -/* printf("\n"); */ + // printf("type=%02d ", type); + // if (msg->any.shifts & KB_SHIFT_FLAG) printf("KB_SHIFT_FLAG "); + // if (msg->any.shifts & KB_CTRL_FLAG) printf("KB_CTRL_FLAG "); + // if (msg->any.shifts & KB_ALT_FLAG) printf("KB_ALT_FLAG "); + // printf("\n"); + // fflush(stdout); return msg; } diff --git a/src/tests/raster/01mask.cpp b/src/tests/raster/01mask.cpp index 1f04106aa..d3ea98b9f 100644 --- a/src/tests/raster/01mask.cpp +++ b/src/tests/raster/01mask.cpp @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) if (!mask) mask = mask_new (); - if (key_shifts & KB_ALT_FLAG) { + if (key[KEY_ALT]) { if (first & 1) mask_replace (mask, MIN (xbeg, xend), diff --git a/src/tools/controllers.h b/src/tools/controllers.h index 955d7c3f5..796c016e8 100644 --- a/src/tools/controllers.h +++ b/src/tools/controllers.h @@ -17,7 +17,7 @@ */ #include -#include // TODO avoid to include this for key_shifts +#include // TODO avoid to include this for key[] #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -81,7 +81,7 @@ public: points[1] = point; // Square aspect - if (key_shifts & KB_SHIFT_FLAG) { // TODO avoid direct access to key_shifts + if (key[KEY_LSHIFT] || key[KEY_RSHIFT]) { int dx = points[1].x - m_center.x; int dy = points[1].y - m_center.y; int minsize = MIN(ABS(dx), ABS(dy)); @@ -125,7 +125,7 @@ public: } // Center - if (key_shifts & KB_CTRL_FLAG) { // TODO avoid direct access to key_shifts + if (key[KEY_LCONTROL] || key[KEY_RCONTROL]) { int rx = points[1].x - m_center.x; int ry = points[1].y - m_center.y; points[0].x = m_center.x - rx; diff --git a/src/util/clipboard.cpp b/src/util/clipboard.cpp index 5dbe4e7e7..4e4f470ba 100644 --- a/src/util/clipboard.cpp +++ b/src/util/clipboard.cpp @@ -481,7 +481,7 @@ static bool interactive_transform(Editor* editor, /* button pressed */ if (jmouse_b(0)) { /* left button+shift || middle button = scroll movement */ - if ((jmouse_b(0) == 1 && (key_shifts & KB_SHIFT_FLAG)) || + if ((jmouse_b(0) == 1 && (key[KEY_LSHIFT] || key[KEY_RSHIFT])) || (jmouse_b(0) == 4)) { JWidget view = jwidget_get_view(editor); int scroll_x, scroll_y; diff --git a/src/widgets/editor/keys.cpp b/src/widgets/editor/keys.cpp index bc8833f75..af5299577 100644 --- a/src/widgets/editor/keys.cpp +++ b/src/widgets/editor/keys.cpp @@ -39,7 +39,11 @@ bool Editor::editor_keys_toset_zoom(int scancode) { if ((m_sprite) && (this->hasMouse()) && - !(key_shifts & (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG))) { + !key[KEY_LSHIFT] && + !key[KEY_RSHIFT] && + !key[KEY_LCONTROL] && + !key[KEY_RCONTROL] && + !key[KEY_ALT]) { JWidget view = jwidget_get_view(this); JRect vp = jview_get_viewport_position(view); int x, y, zoom;