Changeset a2bdcf87 in mainline
- Timestamp:
- 2013-04-12T19:51:45Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6037308
- Parents:
- 3f06dae
- Location:
- uspace/lib/clui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/tinput.c
r3f06dae ra2bdcf87 808 808 static void tinput_key_press(tinput_t *ti, kbd_event_t *kev) 809 809 { 810 if (kev->key == KC_LSHIFT) 811 ti->lshift_held = true; 812 if (kev->key == KC_RSHIFT) 813 ti->rshift_held = true; 814 810 815 if (((kev->mods & KM_CTRL) != 0) && 811 816 ((kev->mods & (KM_ALT | KM_SHIFT)) == 0)) … … 830 835 } 831 836 837 /** Handle key release event. */ 838 static void tinput_key_release(tinput_t *ti, kbd_event_t *kev) 839 { 840 if (kev->key == KC_LSHIFT) 841 ti->lshift_held = false; 842 if (kev->key == KC_RSHIFT) 843 ti->rshift_held = false; 844 } 845 832 846 /** Position event */ 833 847 static void tinput_pos(tinput_t *ti, pos_event_t *ev) 834 848 { 835 849 if (ev->type == POS_PRESS) { 836 tinput_seek_scrpos(ti, ev->hpos, ev->vpos, false); 850 tinput_seek_scrpos(ti, ev->hpos, ev->vpos, 851 ti->lshift_held || ti->rshift_held); 837 852 } 838 853 } … … 875 890 if (ev.ev.key.type == KEY_PRESS) 876 891 tinput_key_press(ti, &ev.ev.key); 892 else 893 tinput_key_release(ti, &ev.ev.key); 877 894 break; 878 895 case CEV_POS: -
uspace/lib/clui/tinput.h
r3f06dae ra2bdcf87 146 146 /** @c true if user requested to abort interactive loop */ 147 147 bool exit_clui; 148 149 /** @c true if left shift key is currently held */ 150 bool lshift_held; 151 152 /** @c true if right shift key is currently held */ 153 bool rshift_held; 148 154 } tinput_t; 149 155
Note:
See TracChangeset
for help on using the changeset viewer.