- keybind_setup: add possibility to disable/enable some special keys

This commit is contained in:
tomworld
2013-07-12 15:50:30 +02:00
committed by svenhoefer
parent c866bf0866
commit ea66aaaf8f
9 changed files with 76 additions and 4 deletions

View File

@@ -188,7 +188,10 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] =
{LOCALE_EXTRA_KEY_SCREENSHOT, &g_settings.key_screenshot, LOCALE_MENU_HINT_KEY_SCREENSHOT },
{LOCALE_EXTRA_KEY_PIP_CLOSE, &g_settings.key_pip_close, LOCALE_MENU_HINT_KEY_PIP_CLOSE },
{LOCALE_EXTRA_KEY_PIP_SETUP, &g_settings.key_pip_setup, LOCALE_MENU_HINT_KEY_PIP_SETUP },
{LOCALE_EXTRA_KEY_PIP_SWAP, &g_settings.key_pip_swap, LOCALE_MENU_HINT_KEY_PIP_CLOSE }
{LOCALE_EXTRA_KEY_PIP_SWAP, &g_settings.key_pip_swap, LOCALE_MENU_HINT_KEY_PIP_CLOSE },
{LOCALE_EXTRA_KEY_FORMAT_MODE, &g_settings.key_format_mode_active, LOCALE_MENU_HINT_KEY_FORMAT_MODE_ACTIVE },
{LOCALE_EXTRA_KEY_PIC_MODE, &g_settings.key_pic_mode_active, LOCALE_MENU_HINT_KEY_PIC_MODE_ACTIVE },
{LOCALE_EXTRA_KEY_PIC_SIZE, &g_settings.key_pic_size_active, LOCALE_MENU_HINT_KEY_PIC_SIZE_ACTIVE }
};
@@ -269,6 +272,8 @@ int CKeybindSetup::showKeySetup()
void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
{
int shortcut = 1;
CMenuForwarder * mf;
bindSettings->addIntroItems(LOCALE_KEYBINDINGMENU_HEAD);
@@ -307,6 +312,14 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
//misc
bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_MISC));
//bindSettings->addItem(new CMenuDForwarder(keydescription[KEY_PLUGIN], true, NULL, keychooser[KEY_PLUGIN]));
//Special keys
CMenuWidget* bindSettings_special = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_SPECIAL);
showKeyBindSpecialSetup(bindSettings_special);
mf = new CMenuDForwarder(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE, true, NULL, bindSettings_special, NULL, CRCInput::convertDigitToKey(shortcut++));
mf->setHint("", LOCALE_MENU_HINT_KEY_SPECIAL_ACTIVE);
bindSettings->addItem(mf);
// unlock
mf = new CMenuDForwarder(key_settings[KEY_UNLOCK].keydescription, true, keychooser[KEY_UNLOCK]->getKeyName(), keychooser[KEY_UNLOCK]);
mf->setHint("", key_settings[KEY_UNLOCK].hint);
@@ -400,6 +413,17 @@ void CKeybindSetup::showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplaye
}
}
void CKeybindSetup::showKeyBindSpecialSetup(CMenuWidget *bindSettings_special)
{
bindSettings_special->addIntroItems(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE);
for (int i = KEY_FORMAT_MODE; i <= KEY_PIC_SIZE; i++) {
CMenuOptionChooser * mf = new CMenuOptionChooser(key_settings[i].keydescription, key_settings[i].keyvalue_p, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
mf->setHint("", key_settings[i].hint);
bindSettings_special->addItem(mf);
}
}
bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* data */)
{
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC) ||