Changeset 6a44ee4 in mainline for uspace/srv/hid/input/ctl/stty.c


Ignore:
Timestamp:
2011-07-20T15:26:21Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/ctl/stty.c

    r25bef0ff r6a44ee4  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2011 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2828
    2929/** @addtogroup kbd_ctl
    30  * @ingroup kbd
     30 * @ingroup input
    3131 * @{
    3232 */
    3333/**
    3434 * @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.
    3638 */
    3739
     
    3941#include <io/keycode.h>
    4042#include <kbd_ctl.h>
     43#include <kbd_port.h>
    4144#include <gsp.h>
    4245#include <stroke.h>
    4346
     47static void stty_ctl_parse(sysarg_t);
     48static int stty_ctl_init(kbd_dev_t *);
     49static void stty_ctl_set_ind(kbd_dev_t *, unsigned int);
     50
     51kbd_ctl_ops_t stty_ctl = {
     52        .parse = stty_ctl_parse,
     53        .init = stty_ctl_init,
     54        .set_ind = stty_ctl_set_ind
     55};
     56
     57static kbd_dev_t *kbd_dev;
     58
    4459/** Scancode parser */
    4560static gsp_t sp;
     
    5065#include <stdio.h>
    5166
    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 */
     72static int seq_defs[] = {
    5373        /* Not shifted */
    5474
     
    6888        0,      KC_MINUS,       0x2d, GSP_END,
    6989        0,      KC_EQUALS,      0x3d, GSP_END,
     90
    7091        0,      KC_BACKSPACE,   0x08, GSP_END,
    7192
     
    203224        0,      KC_RIGHT,       0x1b, 0x5b, 0x43, GSP_END,
    204225
     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
    205233        0,      0
    206234};
    207235
    208 int kbd_ctl_init(void)
     236static int stty_ctl_init(kbd_dev_t *kdev)
    209237{
     238        kbd_dev = kdev;
    210239        ds = 0;
    211240
     
    214243}
    215244
    216 void kbd_ctl_parse_scancode(int scancode)
     245static void stty_ctl_parse(sysarg_t scancode)
    217246{
    218247        unsigned mods, key;
     
    220249        ds = gsp_step(&sp, ds, scancode, &mods, &key);
    221250        if (key != 0) {
    222                 stroke_sim(mods, key);
     251                stroke_sim(kbd_dev, mods, key);
    223252        }
    224253}
    225254
    226 void kbd_ctl_set_ind(unsigned mods)
     255static void stty_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
    227256{
    228257        (void) mods;
Note: See TracChangeset for help on using the changeset viewer.