Changeset 7c169ce in mainline for uspace/drv/usbkbd/main.c


Ignore:
Timestamp:
2011-01-21T13:01:58Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e2b1548
Parents:
6336b6e (diff), a1d12f4 (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:

Merged development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbkbd/main.c

    r6336b6e r7c169ce  
    4242#include "descdump.h"
    4343#include "conv.h"
     44#include "layout.h"
    4445
    4546#define BUFFER_SIZE 32
     
    125126static unsigned lock_keys;
    126127
     128#define NUM_LAYOUTS 3
     129
     130static layout_op_t *layout[NUM_LAYOUTS] = {
     131        &us_qwerty_op,
     132        &us_dvorak_op,
     133        &cz_op
     134};
     135
    127136// TODO: put to device?
    128 //static int active_layout = 0;
     137static int active_layout = 0;
    129138
    130139static void kbd_push_ev(int type, unsigned int key)
     
    206215        ev.mods = mods;
    207216
    208         //ev.c = layout[active_layout]->parse_ev(&ev);
     217        ev.c = layout[active_layout]->parse_ev(&ev);
    209218
    210219        printf("Sending key %d to the console\n", ev.key);
    211220        assert(console_callback_phone != -1);
    212         async_msg_4(console_callback_phone, KBD_EVENT, ev.type, ev.key, ev.mods, 0);
     221        async_msg_4(console_callback_phone, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
    213222}
    214223/*
     
    405414        //usb_hid_parse_report(kbd_dev->parser, buffer, actual_size, callbacks,
    406415        //    NULL);
    407 //      printf("Calling usb_hid_boot_keyboard_input_report() with size %d\n",
    408 //          actual_size);
    409 //      dump_buffer("bufffer: ", buffer, actual_size);
     416        printf("Calling usb_hid_boot_keyboard_input_report() with size %d\n",
     417            actual_size);
     418        //dump_buffer("bufffer: ", buffer, actual_size);
    410419        int rc = usb_hid_boot_keyboard_input_report(buffer, actual_size, callbacks,
    411420            NULL);
     
    457466                 */
    458467                if (actual_size == 0) {
    459                         printf("Keyboar returned NAK\n");
     468                        printf("Keyboard returned NAK\n");
    460469                        continue;
    461470                }
     
    465474                 */
    466475                printf("Calling usbkbd_process_interrupt_in()\n");
    467                 // actual_size is not set, workaround...
    468                 usbkbd_process_interrupt_in(kbd_dev, buffer, /*actual_size*/8);
     476                usbkbd_process_interrupt_in(kbd_dev, buffer, actual_size);
    469477        }
    470478
Note: See TracChangeset for help on using the changeset viewer.