Changeset 6a44ee4 in mainline for uspace/srv/hid/input/ctl/stty.c
- Timestamp:
- 2011-07-20T15:26:21Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efcebe1
- Parents:
- 25bef0ff (diff), a701812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/ctl/stty.c
r25bef0ff r6a44ee4 1 1 /* 2 * Copyright (c) 20 09Jiri Svoboda2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 28 28 29 29 /** @addtogroup kbd_ctl 30 * @ingroup kbd30 * @ingroup input 31 31 * @{ 32 32 */ 33 33 /** 34 34 * @file 35 * @brief Serial TTY-like keyboard controller driver. 35 * @brief Serial TTY-like keyboard controller driver. 36 * 37 * Keyboard emulation on a serial terminal. 36 38 */ 37 39 … … 39 41 #include <io/keycode.h> 40 42 #include <kbd_ctl.h> 43 #include <kbd_port.h> 41 44 #include <gsp.h> 42 45 #include <stroke.h> 43 46 47 static void stty_ctl_parse(sysarg_t); 48 static int stty_ctl_init(kbd_dev_t *); 49 static void stty_ctl_set_ind(kbd_dev_t *, unsigned int); 50 51 kbd_ctl_ops_t stty_ctl = { 52 .parse = stty_ctl_parse, 53 .init = stty_ctl_init, 54 .set_ind = stty_ctl_set_ind 55 }; 56 57 static kbd_dev_t *kbd_dev; 58 44 59 /** Scancode parser */ 45 60 static gsp_t sp; … … 50 65 #include <stdio.h> 51 66 52 int seq_defs[] = { 67 /** 68 * Sequnece definitions are primarily for Xterm. Additionally we define 69 * sequences that are unique to Gnome terminal -- most are the same but 70 * some differ. 71 */ 72 static int seq_defs[] = { 53 73 /* Not shifted */ 54 74 … … 68 88 0, KC_MINUS, 0x2d, GSP_END, 69 89 0, KC_EQUALS, 0x3d, GSP_END, 90 70 91 0, KC_BACKSPACE, 0x08, GSP_END, 71 92 … … 203 224 0, KC_RIGHT, 0x1b, 0x5b, 0x43, GSP_END, 204 225 226 /* 227 * Sequences specific to Gnome terminal 228 */ 229 0, KC_BACKSPACE, 0x7f, GSP_END, /* ASCII DEL */ 230 0, KC_HOME, 0x1b, 0x4f, 0x48, GSP_END, 231 0, KC_END, 0x1b, 0x4f, 0x46, GSP_END, 232 205 233 0, 0 206 234 }; 207 235 208 int kbd_ctl_init(void)236 static int stty_ctl_init(kbd_dev_t *kdev) 209 237 { 238 kbd_dev = kdev; 210 239 ds = 0; 211 240 … … 214 243 } 215 244 216 void kbd_ctl_parse_scancode(int scancode)245 static void stty_ctl_parse(sysarg_t scancode) 217 246 { 218 247 unsigned mods, key; … … 220 249 ds = gsp_step(&sp, ds, scancode, &mods, &key); 221 250 if (key != 0) { 222 stroke_sim( mods, key);251 stroke_sim(kbd_dev, mods, key); 223 252 } 224 253 } 225 254 226 void kbd_ctl_set_ind(unsigned mods)255 static void stty_ctl_set_ind(kbd_dev_t *kdev, unsigned mods) 227 256 { 228 257 (void) mods;
Note:
See TracChangeset
for help on using the changeset viewer.