Changeset 6907f26 in mainline for uspace/lib/vt/include


Ignore:
Timestamp:
2024-10-03T15:42:59Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
d05c237
Parents:
d31c3ea
git-author:
Jiri Svoboda <jiri@…> (2024-10-02 17:42:46)
git-committer:
Jiri Svoboda <jiri@…> (2024-10-03 15:42:59)
Message:

Parse VT100 keyboard escape sequences in libvt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/vt/include/vt/vt100.h

    rd31c3ea r6907f26  
    3636
    3737#include <io/charfield.h>
     38#include <io/keycode.h>
    3839#include <ipc/common.h>
    3940#include <uchar.h>
     
    7576        void (*control_puts)(void *, const char *);
    7677        void (*flush)(void *);
     78        void (*key)(void *, keymod_t, keycode_t, char);
    7779} vt100_cb_t;
     80
     81/** VT100 decoding state */
     82typedef enum {
     83        /** Base state */
     84        vts_base,
     85        /** Prefix 1b */
     86        vts_1b,
     87        /** Prefix 1b 4f */
     88        vts_1b4f,
     89        /** Prefix 1b 5b */
     90        vts_1b5b,
     91        /** Prefix 1b 5b 31 */
     92        vts_1b5b31,
     93        /** Prefix 1b 5b 31 35 */
     94        vts_1b5b3135,
     95        /** Prefix 1b 5b 31 37 */
     96        vts_1b5b3137,
     97        /** Prefix 1b 5b 31 38 */
     98        vts_1b5b3138,
     99        /** Prefix 1b 5b 31 39 */
     100        vts_1b5b3139,
     101        /** Prefix 1b 5b 32 */
     102        vts_1b5b32,
     103        /** Prefix 1b 5b 32 30 */
     104        vts_1b5b3230,
     105        /** Prefix 1b 5b 32 31 */
     106        vts_1b5b3231,
     107        /** Prefix 1b 5b 32 33 */
     108        vts_1b5b3233,
     109        /** Prefix 1b 5b 32 34 */
     110        vts_1b5b3234,
     111        /** Prefix 1b 5b 32 35 */
     112        vts_1b5b3235,
     113        /** Prefix 1b 5b 32 38 */
     114        vts_1b5b3238,
     115        /** Prefix 1b 5b 35 */
     116        vts_1b5b35,
     117        /** Prefix 1b 5b 33 */
     118        vts_1b5b33,
     119        /** Prefix 1b 5b 36 */
     120        vts_1b5b36
     121} vt100_state_t;
    78122
    79123/** VT100 instance */
     
    98142        /** Argument to callback functions */
    99143        void *arg;
     144
     145        /** Input decoding state */
     146        vt100_state_t state;
    100147} vt100_t;
    101148
     
    119166extern void vt100_flush(vt100_t *);
    120167
     168extern void vt100_rcvd_char(vt100_t *, char);
     169
    121170#endif
    122171
Note: See TracChangeset for help on using the changeset viewer.