Changeset 203 for libcaca


Ignore:
Timestamp:
Nov 21, 2003, 3:14:26 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • src/io.c: + Fixed an off-by-one error in the mouse driver.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/io.c

    r201 r203  
    7676    if(key[1] == 'O')
    7777    {
     78        /* ^[OP ^[OQ ^[OR ^[OS */
    7879        switch(key[2])
    7980        {
     
    8687    else if(key[1] == '[')
    8788    {
     89        /* ^[[A ^[[B ^[[C ^[[D */
    8890        switch(key[2])
    8991        {
     
    9799        key[4] = _read_key();
    98100
     101        /* ^[[Mxxx */
    99102        if(key[2] == 'M')
    100103        {
     
    104107
    105108            event |= (int)(key[3] - ' ') << 16;
    106             event |= (int)(key[4] - ' ') << 8;
    107             event |= (int)(key[5] - ' ') << 0;
     109            event |= (int)(key[4] - '!') << 8;
     110            event |= (int)(key[5] - '!') << 0;
    108111
    109112            return event;
    110113        }
    111114
     115        /* ^[[15~ ^[[17~ ^[[18~ ^[[19~ */
    112116        if(key[2] == '1' && key[4] == '~')
    113117            switch(key[3])
     
    119123            }
    120124
     125        /* ^[[20~ ^[[21~ ^[[23~ ^[[24~ */
    121126        if(key[2] == '2' && key[4] == '~')
    122127            switch(key[3])
Note: See TracChangeset for help on using the changeset viewer.