GNU bug report logs - #34978
Enable support for veyron chrombooks

Previous Next

Package: guix-patches;

Reported by: Vagrant Cascadian <vagrant <at> debian.org>

Date: Sun, 24 Mar 2019 18:04:02 UTC

Severity: normal

Tags: fixed

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Vagrant Cascadian <vagrant <at> debian.org>, 34978 <at> debbugs.gnu.org
Subject: [bug#34978] Enable support for veyron chrombooks
Date: Wed, 3 Apr 2019 18:59:57 +0200
[Message part 1 (text/plain, inline)]
> BTW, if U-Boot and Depthcharge are able to install custom keymaps, it’d
> be nice to implement that support like commit
> 8d058e7b1b1a409d3d9cc29c5650a98db4e78783 does for GRUB.

Heh, I wish U-Boot did that, but it really doesn't:

/* Translate the scancode in ASCII */
static int usb_kbd_translate(struct usb_kbd_pdata *data, unsigned char scancode,
                                unsigned char modifier, int pressed)
{
        uint8_t keycode = 0;

        /* Key released */
        if (pressed == 0) {
                data->repeat_delay = 0;
                return 0;
        }

        if (pressed == 2) {
                data->repeat_delay++;
                if (data->repeat_delay < REPEAT_DELAY)
                        return 0;

                data->repeat_delay = REPEAT_DELAY;
        }

        /* Alphanumeric values */
        if ((scancode > 3) && (scancode <= 0x1d)) {
                keycode = scancode - 4 + 'a';

                if (data->flags & USB_KBD_CAPSLOCK)
                        keycode &= ~CAPITAL_MASK;

                if (modifier & (LEFT_SHIFT | RIGHT_SHIFT)) {
                        /* Handle CAPSLock + Shift pressed simultaneously */
                        if (keycode & CAPITAL_MASK)
                                keycode &= ~CAPITAL_MASK;
                        else
                                keycode |= CAPITAL_MASK;
                }
        }

        if ((scancode > 0x1d) && (scancode < 0x39)) {
                /* Shift pressed */
                if (modifier & (LEFT_SHIFT | RIGHT_SHIFT))
                        keycode = usb_kbd_numkey_shifted[scancode - 0x1e];
                else
                        keycode = usb_kbd_numkey[scancode - 0x1e];
        }

        /* Arrow keys */
        if ((scancode >= 0x4f) && (scancode <= 0x52))
                keycode = usb_kbd_arrow[scancode - 0x4f];

        /* Numeric keypad */
        if ((scancode >= 0x54) && (scancode <= 0x67))
                keycode = usb_kbd_num_keypad[scancode - 0x54];

        if (data->flags & USB_KBD_CTRL)
                keycode = scancode - 0x3;

        if (pressed == 1) {
                if (scancode == NUM_LOCK) {
                        data->flags ^= USB_KBD_NUMLOCK;
                        return 1;
                }

                if (scancode == CAPS_LOCK) {
                        data->flags ^= USB_KBD_CAPSLOCK;
                        return 1;
                }
                if (scancode == SCROLL_LOCK) {
                        data->flags ^= USB_KBD_SCROLLLOCK;
                        return 1;
                }
        }

        /* Report keycode if any */
        if (keycode) {
                debug("%c", keycode);
                usb_kbd_put_queue(data, keycode);
        }

        return 0;
}
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 6 years and 128 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.