Skip to content

Commit

Permalink
fix slight issue with action mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
stormymcstorm committed Apr 13, 2023
1 parent 09cc47a commit adf4532
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions jesture/components/gesture_list_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void GestureListItem::handle_action_type(int index) {

jesturepipe::CursorControl GestureListItem::get_cursor_control() {
switch (cursor_combo->currentIndex()) {
default:
case 0:
return jesturepipe::CursorControl::None;
case 1:
return jesturepipe::CursorControl::Grab;
Expand All @@ -93,7 +93,7 @@ jesturepipe::CursorControl GestureListItem::get_cursor_control() {

Action GestureListItem::get_action() {
switch (action_combo->currentIndex()) {
default:
case 0:
return NoOp();
case 1:
return MouseClick(mouse_combo->currentIndex());
Expand All @@ -114,12 +114,16 @@ void GestureListItem::initialize_fields(ActionsList action_list) {
switch (action_list.cursor_control) {
case jesturepipe::CursorControl::None:
cursor_combo->setCurrentIndex(0);
break;
case jesturepipe::CursorControl::Grab:
cursor_combo->setCurrentIndex(1);
break;
case jesturepipe::CursorControl::Release:
cursor_combo->setCurrentIndex(2);
break;
case jesturepipe::CursorControl::Toggle:
cursor_combo->setCurrentIndex(3);
break;
}

if (action_list.action_list.empty()) {
Expand Down
3 changes: 2 additions & 1 deletion jesture/jesturepipe/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Action KeysRelease(const QKeySequence &keys);

typedef struct ActionsList {
std::vector<Action> action_list;
jesturepipe::CursorControl cursor_control;
jesturepipe::CursorControl cursor_control =
jesturepipe::CursorControl::None;
} ActionsList;

} // namespace jesture
Expand Down

0 comments on commit adf4532

Please sign in to comment.