diff options
author | Ran Benita <ran234@gmail.com> | 2014-02-16 10:59:42 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2014-02-16 11:05:32 +0200 |
commit | 18191702ae993bbbc64a7f7c2008f28d7c2c5531 (patch) | |
tree | 3a24bfaff60581179221562e902cbbd11cc1cd5b /src | |
parent | af261cb605a038170af0842b6b4c5b2eb1d0b03e (diff) | |
download | libxkbcommon-18191702ae993bbbc64a7f7c2008f28d7c2c5531.tar.gz libxkbcommon-18191702ae993bbbc64a7f7c2008f28d7c2c5531.tar.bz2 libxkbcommon-18191702ae993bbbc64a7f7c2008f28d7c2c5531.zip |
keymap: change action flag NO_ACCEL -> ACCEL
It's easier to deal with, but we need to set it as "factory default".
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/keymap.h | 2 | ||||
-rw-r--r-- | src/x11/keymap.c | 4 | ||||
-rw-r--r-- | src/xkbcomp/action.c | 5 | ||||
-rw-r--r-- | src/xkbcomp/keymap-dump.c | 8 |
4 files changed, 9 insertions, 10 deletions
diff --git a/src/keymap.h b/src/keymap.h index 09d711f..39ac420 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -146,7 +146,7 @@ enum xkb_action_flags { ACTION_ABSOLUTE_SWITCH = (1 << 5), ACTION_ABSOLUTE_X = (1 << 6), ACTION_ABSOLUTE_Y = (1 << 7), - ACTION_NO_ACCEL = (1 << 8), + ACTION_ACCEL = (1 << 8), ACTION_SAME_SCREEN = (1 << 9), }; diff --git a/src/x11/keymap.c b/src/x11/keymap.c index 49ff132..c68f67f 100644 --- a/src/x11/keymap.c +++ b/src/x11/keymap.c @@ -221,8 +221,8 @@ translate_action(union xkb_action *action, const xcb_xkb_action_t *wire) action->ptr.x = (wire->moveptr.xLow | (wire->moveptr.xHigh << 8)); action->ptr.y = (wire->moveptr.yLow | (wire->moveptr.yHigh << 8)); - if (wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_NO_ACCELERATION) - action->ptr.flags |= ACTION_NO_ACCEL; + if (!(wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_NO_ACCELERATION)) + action->ptr.flags |= ACTION_ACCEL; if (wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_MOVE_ABSOLUTE_X) action->ptr.flags |= ACTION_ABSOLUTE_X; if (wire->moveptr.flags & XCB_XKB_SA_MOVE_PTR_FLAG_MOVE_ABSOLUTE_Y) diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c index ad7f43f..018d4a8 100644 --- a/src/xkbcomp/action.c +++ b/src/xkbcomp/action.c @@ -118,6 +118,7 @@ NewActionsInfo(void) /* Increment default button. */ info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.flags = 0; info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.value = 1; + info->actions[ACTION_TYPE_PTR_MOVE].ptr.flags = ACTION_ACCEL; info->actions[ACTION_TYPE_SWITCH_VT].screen.flags = ACTION_SAME_SCREEN; return info; @@ -466,9 +467,9 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action, return ReportMismatch(keymap->ctx, action->type, field, "boolean"); if (set) - act->flags &= ~ACTION_NO_ACCEL; + act->flags |= ACTION_ACCEL; else - act->flags |= ACTION_NO_ACCEL; + act->flags &= ~ACTION_ACCEL; } return ReportIllegal(keymap->ctx, action->type, field); diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c index 9e25ede..7f70ca3 100644 --- a/src/xkbcomp/keymap-dump.c +++ b/src/xkbcomp/keymap-dump.c @@ -334,13 +334,11 @@ write_action(struct xkb_keymap *keymap, struct buf *buf, case ACTION_TYPE_PTR_MOVE: write_buf(buf, "%s%s(x=%s%d,y=%s%d%s)%s", prefix, type, - (!(action->ptr.flags & ACTION_ABSOLUTE_X) && - action->ptr.x >= 0) ? "+" : "", + (!(action->ptr.flags & ACTION_ABSOLUTE_X) && action->ptr.x >= 0) ? "+" : "", action->ptr.x, - (!(action->ptr.flags & ACTION_ABSOLUTE_Y) && - action->ptr.y >= 0) ? "+" : "", + (!(action->ptr.flags & ACTION_ABSOLUTE_Y) && action->ptr.y >= 0) ? "+" : "", action->ptr.y, - (action->ptr.flags & ACTION_NO_ACCEL) ? ",!accel" : "", + (action->ptr.flags & ACTION_ACCEL) ? "" : ",!accel", suffix); break; |