* Changed the way the shortcuts are switched: we no longer do the same thing

as BeOS on the right side (that is, switching control and option key), but
  switch control and command there as well.
* As a consequence, the Alt-Gr key will stay where it is when switching the
  shortcuts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29929 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-04-05 13:00:51 +00:00
parent c21f81c11a
commit 6db2be327d
2 changed files with 12 additions and 13 deletions

View File

@ -152,7 +152,7 @@ KeymapWindow::KeymapWindow()
fAppliedMap = fCurrentMap;
fCurrentMap.SetTarget(this, new BMessage(kMsgKeymapUpdated));
_UpdateShortcutButton();
_UpdateSwitchShortcutButton();
Unlock();
}
@ -437,19 +437,18 @@ KeymapWindow::_AddKeyboardLayouts(BMenu* menu)
}
/*! Sets the label of the "Switch Shorcuts" button to make it more
descriptive what will happen when you press that button.
*/
void
KeymapWindow::_UpdateShortcutButton()
KeymapWindow::_UpdateSwitchShortcutButton()
{
const char* label = "Switch Shortcut Keys";
if (fCurrentMap.KeyForModifier(B_LEFT_COMMAND_KEY) == 0x5d
&& fCurrentMap.KeyForModifier(B_LEFT_CONTROL_KEY) == 0x5c
&& fCurrentMap.KeyForModifier(B_RIGHT_OPTION_KEY) == 0x5f
&& fCurrentMap.KeyForModifier(B_RIGHT_CONTROL_KEY) == 0x60) {
&& fCurrentMap.KeyForModifier(B_LEFT_CONTROL_KEY) == 0x5c) {
label = "Switch Shortcut Keys To Windows/Linux Mode";
} else if (fCurrentMap.KeyForModifier(B_LEFT_COMMAND_KEY) == 0x5c
&& fCurrentMap.KeyForModifier(B_LEFT_CONTROL_KEY) == 0x5d
&& fCurrentMap.KeyForModifier(B_RIGHT_OPTION_KEY) == 0x60
&& fCurrentMap.KeyForModifier(B_RIGHT_CONTROL_KEY) == 0x5f) {
&& fCurrentMap.KeyForModifier(B_LEFT_CONTROL_KEY) == 0x5d) {
label = "Switch Shortcut Keys To Haiku Mode";
}
@ -463,7 +462,7 @@ KeymapWindow::_UpdateButtons()
fUseButton->SetEnabled(!fCurrentMap.Equals(fAppliedMap));
fRevertButton->SetEnabled(!fCurrentMap.Equals(fPreviousMap));
_UpdateShortcutButton();
_UpdateSwitchShortcutButton();
}
@ -472,7 +471,7 @@ KeymapWindow::_SwitchShortcutKeys()
{
uint32 leftCommand = fCurrentMap.Map().left_command_key;
uint32 leftControl = fCurrentMap.Map().left_control_key;
uint32 rightOption = fCurrentMap.Map().right_option_key;
uint32 rightCommand = fCurrentMap.Map().right_command_key;
uint32 rightControl = fCurrentMap.Map().right_control_key;
// switch left side
@ -480,8 +479,8 @@ KeymapWindow::_SwitchShortcutKeys()
fCurrentMap.Map().left_control_key = leftCommand;
// switch right side
fCurrentMap.Map().right_option_key = rightControl;
fCurrentMap.Map().right_control_key = rightOption;
fCurrentMap.Map().right_command_key = rightControl;
fCurrentMap.Map().right_control_key = rightCommand;
fKeyboardLayoutView->SetKeymap(&fCurrentMap);
_UpdateButtons();

View File

@ -39,7 +39,7 @@ protected:
BView* _CreateMapLists();
void _AddKeyboardLayouts(BMenu* menu);
void _UpdateShortcutButton();
void _UpdateSwitchShortcutButton();
void _UpdateButtons();
void _SwitchShortcutKeys();