Changeset b2c9e42c in mainline


Ignore:
Timestamp:
2024-10-03T18:21:04Z (8 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
e273e9e
Parents:
d05c237
Message:

Move link out of kbd_event_t

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/input/include/io/kbd_event.h

    rd05c237 rb2c9e42c  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3636#define _LIBINPUT_IO_KBD_EVENT_H_
    3737
    38 #include <adt/list.h>
    3938#include <inttypes.h>
    4039#include <io/keycode.h>
     
    4847/** Console event structure. */
    4948typedef struct {
    50         /** List handle */
    51         link_t link;
    52 
    5349        /** Keyboard device ID */
    5450        sysarg_t kbd_id;
  • uspace/lib/ui/include/types/ui/testctl.h

    rd05c237 rb2c9e42c  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3636#ifndef _UI_TYPES_TESTCTL_H
    3737#define _UI_TYPES_TESTCTL_H
     38
     39#include <errno.h>
     40#include <io/kbd_event.h>
     41#include <io/pos_event.h>
     42#include <stdbool.h>
     43#include <types/ui/event.h>
    3844
    3945struct ui_test_ctl;
  • uspace/srv/hid/remcons/remcons.c

    rd05c237 rb2c9e42c  
    348348 * @param c Pressed character.
    349349 */
    350 static kbd_event_t *new_kbd_event(kbd_event_type_t type, keymod_t mods,
     350static remcons_event_t *new_kbd_event(kbd_event_type_t type, keymod_t mods,
    351351    keycode_t key, char c)
    352352{
    353         kbd_event_t *event = malloc(sizeof(kbd_event_t));
     353        remcons_event_t *event = malloc(sizeof(remcons_event_t));
    354354        assert(event);
    355355
    356356        link_initialize(&event->link);
    357         event->type = type;
    358         event->mods = mods;
    359         event->key = key;
    360         event->c = c;
     357        event->kbd.type = type;
     358        event->kbd.mods = mods;
     359        event->kbd.key = key;
     360        event->kbd.c = c;
    361361
    362362        return event;
     
    381381
    382382        link_t *link = prodcons_consume(&remcons->in_events);
    383         kbd_event_t *tmp = list_get_instance(link, kbd_event_t, link);
     383        remcons_event_t *tmp = list_get_instance(link, remcons_event_t, link);
    384384
    385385        event->type = CEV_KEY;
    386         event->ev.key = *tmp;
     386        event->ev.key = tmp->kbd;
    387387
    388388        free(tmp);
     
    587587        remcons_t *remcons = (remcons_t *)arg;
    588588
    589         kbd_event_t *down = new_kbd_event(KEY_PRESS, mods, key, c);
    590         kbd_event_t *up = new_kbd_event(KEY_RELEASE, mods, key, c);
     589        remcons_event_t *down = new_kbd_event(KEY_PRESS, mods, key, c);
     590        remcons_event_t *up = new_kbd_event(KEY_RELEASE, mods, key, c);
    591591        assert(down);
    592592        assert(up);
  • uspace/srv/hid/remcons/remcons.h

    rd05c237 rb2c9e42c  
    3838
    3939#include <adt/prodcons.h>
     40#include <io/kbd_event.h>
    4041#include <stdbool.h>
    4142#include <vt/vt100.h>
     
    5657        bool curs_visible;      /**< cursor is visible */
    5758
    58         /** Producer-consumer of kbd_event_t. */
     59        /** Producer-consumer of remcons_event_t. */
    5960        prodcons_t in_events;
    6061} remcons_t;
     62
     63/** Remote console event */
     64typedef struct {
     65        link_t link;            /**< link to list of events */
     66        kbd_event_t kbd;        /**< keyboard event */
     67} remcons_event_t;
    6168
    6269#endif
Note: See TracChangeset for help on using the changeset viewer.