- removed support for old-style syntax userbutton shortcuts
- added "power" key to the list of valid userbutton shortcuts
This commit is contained in:
parent
06e3615239
commit
b2baef2c34
@ -661,13 +661,11 @@ keyboard_mapping: enabled=0, map=
|
||||
# USER_SHORTCUT:
|
||||
# This defines the keyboard shortcut to be sent when you press the "user"
|
||||
# button in the headerbar. The shortcut string is a combination of maximum
|
||||
# 3 key names (listed below) separated with a '-' character. The old-style
|
||||
# syntax (without the '-') still works for the key combinations supported
|
||||
# in Bochs 2.2.1.
|
||||
# 3 key names (listed below) separated with a '-' character.
|
||||
# Valid key names:
|
||||
# "alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc",
|
||||
# "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup",
|
||||
# "plus", "right", "shift", "space", "tab", "up", "win" and "print".
|
||||
# "plus", "right", "shift", "space", "tab", "up", "win", "print" and "power".
|
||||
#
|
||||
# Example:
|
||||
# user_shortcut: keys=ctrl-alt-del
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
================================================================
|
||||
doc/docbook/user/user.dbk
|
||||
$Id: user.dbk,v 1.236 2008-03-30 18:32:41 sshwarts Exp $
|
||||
$Id: user.dbk,v 1.237 2008-05-04 09:29:44 vruppert Exp $
|
||||
|
||||
This is the top level file for the Bochs Users Manual.
|
||||
================================================================
|
||||
@ -4161,8 +4161,6 @@ Examples:
|
||||
This defines the keyboard shortcut to be sent when you press the "user" button
|
||||
in the <link linkend="headerbar">headerbar</link>. The shortcut string is a
|
||||
combination of maximum 3 key names (listed below) separated with a '-' character.
|
||||
The old-style syntax (without the '-') still works for the key combinations
|
||||
supported in Bochs 2.2.1.
|
||||
</para>
|
||||
<para>
|
||||
Valid key names:
|
||||
@ -4170,7 +4168,7 @@ Valid key names:
|
||||
<para>
|
||||
"alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc",
|
||||
"f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", "plus",
|
||||
"right", "shift", "space", "tab", "up", "win" and "print".
|
||||
"right", "shift", "space", "tab", "up", "win", "print" and "power".
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
@ -755,15 +755,13 @@ Example:
|
||||
.I "user_shortcut:"
|
||||
This defines the keyboard shortcut to be sent when you press the "user"
|
||||
button in the header bar. The shortcut string is a combination of maximum
|
||||
3 key names (listed below) separated with a '-' character. The old-style
|
||||
syntax (without the '-') still works for the key combinations supported
|
||||
in Bochs 2.2.1.
|
||||
3 key names (listed below) separated with a '-' character.
|
||||
|
||||
Valid key names:
|
||||
|
||||
"alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc",
|
||||
"f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", "plus",
|
||||
"right", "shift", "space", "tab", "up", "win" and "print".
|
||||
"right", "shift", "space", "tab", "up", "win", "print" and "power".
|
||||
|
||||
Example:
|
||||
user_shortcut: keys=ctrl-alt-del
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: gui.cc,v 1.104 2008-02-15 22:05:40 sshwarts Exp $
|
||||
// $Id: gui.cc,v 1.105 2008-05-04 09:29:45 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -51,7 +51,7 @@ bx_gui_c *bx_gui = NULL;
|
||||
#define LOG_THIS BX_GUI_THIS
|
||||
|
||||
#define BX_KEY_UNKNOWN 0x7fffffff
|
||||
#define N_USER_KEYS 36
|
||||
#define N_USER_KEYS 37
|
||||
|
||||
typedef struct {
|
||||
const char *key;
|
||||
@ -95,7 +95,8 @@ static user_key_t user_keys[N_USER_KEYS] =
|
||||
{ "tab", BX_KEY_TAB },
|
||||
{ "up", BX_KEY_UP },
|
||||
{ "win", BX_KEY_WIN_L },
|
||||
{ "print", BX_KEY_PRINT }
|
||||
{ "print", BX_KEY_PRINT },
|
||||
{ "power", BX_KEY_POWER_POWER }
|
||||
};
|
||||
|
||||
bx_gui_c::bx_gui_c(void)
|
||||
@ -552,39 +553,8 @@ void bx_gui_c::userbutton_handler(void)
|
||||
ptr = strtok(NULL, "-");
|
||||
}
|
||||
} else {
|
||||
while ((ptr[0]) && (len < 3)) {
|
||||
if (!strncmp(ptr, "alt", 3)) {
|
||||
shortcut[len++] = BX_KEY_ALT_L;
|
||||
ptr += 3;
|
||||
} else if (!strncmp(ptr, "ctrl", 4)) {
|
||||
shortcut[len++] = BX_KEY_CTRL_L;
|
||||
ptr += 4;
|
||||
} else if (!strncmp(ptr, "del", 3)) {
|
||||
shortcut[len++] = BX_KEY_DELETE;
|
||||
ptr += 3;
|
||||
} else if (!strncmp(ptr, "esc", 3)) {
|
||||
shortcut[len++] = BX_KEY_ESC;
|
||||
ptr += 3;
|
||||
} else if (!strncmp(ptr, "f1", 2)) {
|
||||
shortcut[len++] = BX_KEY_F1;
|
||||
ptr += 2;
|
||||
} else if (!strncmp(ptr, "f4", 2)) {
|
||||
shortcut[len++] = BX_KEY_F4;
|
||||
ptr += 2;
|
||||
} else if (!strncmp(ptr, "tab", 3)) {
|
||||
shortcut[len++] = BX_KEY_TAB;
|
||||
ptr += 3;
|
||||
} else if (!strncmp(ptr, "win", 3)) {
|
||||
shortcut[len++] = BX_KEY_WIN_L;
|
||||
ptr += 3;
|
||||
} else if (!strncmp(ptr, "bksp", 4)) {
|
||||
shortcut[len++] = BX_KEY_BACKSPACE;
|
||||
ptr += 4;
|
||||
} else {
|
||||
BX_ERROR(("Unknown shortcut %s ignored", user_shortcut));
|
||||
return;
|
||||
}
|
||||
}
|
||||
BX_ERROR(("Unknown shortcut %s ignored", user_shortcut));
|
||||
return;
|
||||
}
|
||||
i = 0;
|
||||
while (i < len) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user