Changeset a2bdcf87 in mainline for uspace/lib/clui/tinput.c


Ignore:
Timestamp:
2013-04-12T19:51:45Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6037308
Parents:
3f06dae
Message:

Honor shift (select) during mouse seek.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/clui/tinput.c

    r3f06dae ra2bdcf87  
    808808static void tinput_key_press(tinput_t *ti, kbd_event_t *kev)
    809809{
     810        if (kev->key == KC_LSHIFT)
     811                ti->lshift_held = true;
     812        if (kev->key == KC_RSHIFT)
     813                ti->rshift_held = true;
     814
    810815        if (((kev->mods & KM_CTRL) != 0) &&
    811816            ((kev->mods & (KM_ALT | KM_SHIFT)) == 0))
     
    830835}
    831836
     837/** Handle key release event. */
     838static 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
    832846/** Position event */
    833847static void tinput_pos(tinput_t *ti, pos_event_t *ev)
    834848{
    835849        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);
    837852        }
    838853}
     
    875890                        if (ev.ev.key.type == KEY_PRESS)
    876891                                tinput_key_press(ti, &ev.ev.key);
     892                        else
     893                                tinput_key_release(ti, &ev.ev.key);
    877894                        break;
    878895                case CEV_POS:
Note: See TracChangeset for help on using the changeset viewer.