- Changed Alt/Ctrl mode handling in Menu prefs, BMenu and Appearance

prefs as discussed in #2139 comments. This allow using Alt-Gr in either 
Ctrl or Alt mode. Appearance needs a serious style cleanup, comming next 
:)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27095 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2008-08-21 00:59:30 +00:00
parent 996be6dbb5
commit 009aa366c6
3 changed files with 8 additions and 13 deletions

View File

@ -348,7 +348,7 @@ BMenu::AttachedToWindow()
char *chars = NULL;
get_key_map(&keys, &chars);
if (keys == NULL || keys->left_command_key != 0x5d
|| keys->right_command_key != 0x5f)
|| keys->left_control_key != 0x5c)
sAltAsCommandKey = false;
free(chars);
free(keys);

View File

@ -318,11 +318,13 @@ void MenuView::MarkCommandKey(void)
get_key_map(&keys, &chars);
altcommand=(keys->left_command_key==0x5d) && (keys->right_command_key==0x5f);
bool altAsShortcut = (keys->left_command_key == 0x5d)
&& (keys->left_control_key == 0x5c);
free(chars);
free(keys);
if(altcommand)
if(altAsShortcut)
altcmd->SetValue(B_CONTROL_ON);
else
ctrlcmd->SetValue(B_CONTROL_ON);
@ -333,18 +335,14 @@ void MenuView::SetCommandKey(bool use_alt)
if(use_alt)
{
set_modifier_key(B_LEFT_COMMAND_KEY, 0x5d);
set_modifier_key(B_RIGHT_COMMAND_KEY, 0x5f);
set_modifier_key(B_LEFT_CONTROL_KEY, 0x5c);
set_modifier_key(B_RIGHT_OPTION_KEY, 0x60);
be_roster->Broadcast(new BMessage(B_MODIFIERS_CHANGED));
}
else
{
set_modifier_key(B_LEFT_COMMAND_KEY, 0x5c);
set_modifier_key(B_RIGHT_COMMAND_KEY, 0x60);
set_modifier_key(B_LEFT_CONTROL_KEY, 0x5d);
set_modifier_key(B_RIGHT_OPTION_KEY, 0x5f);
be_roster->Broadcast(new BMessage(B_MODIFIERS_CHANGED));
}

View File

@ -78,8 +78,9 @@ MenuSettings::AltAsShortcut() const
char* chars;
get_key_map(&keys, &chars);
bool altAsShortcut = (keys->left_command_key == 0x5d)
&& (keys->right_command_key == 0x5f);
bool altAsShortcut = (keys->left_command_key == 0x5d)
&& (keys->left_control_key == 0x5c);
free(chars);
free(keys);
@ -94,15 +95,11 @@ MenuSettings::SetAltAsShortcut(bool altAsShortcut)
if (altAsShortcut) {
// This might not be the same for all keyboards
set_modifier_key(B_LEFT_COMMAND_KEY, 0x5d);
set_modifier_key(B_RIGHT_COMMAND_KEY, 0x5f);
set_modifier_key(B_LEFT_CONTROL_KEY, 0x5c);
set_modifier_key(B_RIGHT_OPTION_KEY, 0x60);
} else {
// This might not be the same for all keyboards
set_modifier_key(B_LEFT_COMMAND_KEY, 0x5c);
set_modifier_key(B_RIGHT_COMMAND_KEY, 0x60);
set_modifier_key(B_LEFT_CONTROL_KEY, 0x5d);
set_modifier_key(B_RIGHT_OPTION_KEY, 0x5f);
}
be_roster->Broadcast(new BMessage(B_MODIFIERS_CHANGED));
}