Changeset a106037 in mainline
- Timestamp:
- 2021-07-21T18:04:12Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 21b0013, 5de71df
- Parents:
- 282c86d
- Location:
- uspace/lib/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/private/entry.h
r282c86d ra106037 68 68 /** Button is held down */ 69 69 bool held; 70 /** Left shift is held down */ 71 bool lshift_held; 72 /** Right shift is held down */ 73 bool rshift_held; 70 74 }; 71 75 -
uspace/lib/ui/src/entry.c
r282c86d ra106037 733 733 } 734 734 735 /* 736 * Need to keep track if any shift is held for the case 737 * of selecting by shift-click. This could be simplified 738 * if position events were decorated with modifier 739 * state. 740 */ 741 742 if (event->type == KEY_PRESS && event->key == KC_LSHIFT) 743 entry->lshift_held = true; 744 if (event->type == KEY_RELEASE && event->key == KC_LSHIFT) 745 entry->lshift_held = false; 746 if (event->type == KEY_PRESS && event->key == KC_RSHIFT) 747 entry->rshift_held = true; 748 if (event->type == KEY_RELEASE && event->key == KC_RSHIFT) 749 entry->rshift_held = false; 750 735 751 if (event->type == KEY_PRESS && 736 752 (event->mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) … … 800 816 entry->held = true; 801 817 entry->pos = ui_entry_find_pos(entry, &pos); 802 entry->sel_start = entry->pos; 818 819 /* Clear selection if no shift key is held */ 820 if (!entry->lshift_held && !entry->rshift_held) 821 entry->sel_start = entry->pos; 822 803 823 if (entry->active) 804 824 ui_entry_paint(entry);
Note:
See TracChangeset
for help on using the changeset viewer.