~vojtech-horky/helenos/helenos-qemu

« back to all changes in this revision

Viewing changes to uspace/lib/posix/source/ansiterm.c

  • Committer: Jan Mares
  • Date: 2015-07-06 10:13:03 UTC
  • Revision ID: maresja1@gmail.com-20150706101303-2w1a2u0o8lbmwxoh
Fixed problem with circular buffer in ansiterm.c.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
static size_t  event_buffer_start = 0;
51
51
 
52
52
static void push_char_to_buffer(char c){
 
53
        event_buffer[event_buffer_end] = c;
53
54
        event_buffer_end = (event_buffer_end + 1) % MAX_EVENT_BUFFER_LEN;
54
 
        event_buffer[event_buffer_end] = c;
55
55
}
56
56
 
57
57
static void push_csi_to_buffer(){
134
134
                        return -1;
135
135
                }
136
136
 
137
 
                if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS) {
 
137
                if (event.type == CEV_KEY && (event.ev.key.type == KEY_PRESS
 
138
                        || (event.type == CEV_KEY && event.ev.key.mods & (KM_ALT | KM_CTRL)))) {
138
139
                        key_code_to_ansi(event);
139
 
 
140
140
                }
141
141
        }
142
142