1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * Copyright (C) 2012-2013 Kay Sievers <kay@vrfy.org>
15 * Copyright (C) 2012 Harald Hoyer <harald@redhat.com>
18 #ifndef __SDBOOT_CONSOLE_H
19 #define __SDBOOT_CONSOLE_H
21 #define EFI_SHIFT_STATE_VALID 0x80000000
22 #define EFI_RIGHT_CONTROL_PRESSED 0x00000004
23 #define EFI_LEFT_CONTROL_PRESSED 0x00000008
24 #define EFI_RIGHT_ALT_PRESSED 0x00000010
25 #define EFI_LEFT_ALT_PRESSED 0x00000020
27 #define EFI_CONTROL_PRESSED (EFI_RIGHT_CONTROL_PRESSED|EFI_LEFT_CONTROL_PRESSED)
28 #define EFI_ALT_PRESSED (EFI_RIGHT_ALT_PRESSED|EFI_LEFT_ALT_PRESSED)
29 #define KEYPRESS(keys, scan, uni) ((((UINT64)keys) << 32) | ((scan) << 16) | (uni))
30 #define KEYCHAR(k) ((k) & 0xffff)
31 #define CHAR_CTRL(c) ((c) - 'a' + 1)
33 EFI_STATUS console_key_read(UINT64 *key, BOOLEAN wait);