本文整理汇总了C++中Starshatter::GetKeyMap方法的典型用法代码示例。如果您正苦于以下问题:C++ Starshatter::GetKeyMap方法的具体用法?C++ Starshatter::GetKeyMap怎么用?C++ Starshatter::GetKeyMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Starshatter
的用法示例。
在下文中一共展示了Starshatter::GetKeyMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
KeyDlg::OnApply(AWEvent* event)
{
Starshatter* stars = Starshatter::GetInstance();
if (stars) {
KeyMap& keymap = stars->GetKeyMap();
KeyMapEntry* map = keymap.GetKeyMap(key_index);
if (key_clear) {
map->key = 0;
map->alt = 0;
map->joy = 0;
}
if (key_key) {
map->key = key_key;
map->alt = key_shift;
}
if (key_joy) {
map->joy = key_joy;
}
}
if (manager)
manager->ShowCtlDlg();
}
示例2:
void
JoyDlg::OnApply(AWEvent* event)
{
Starshatter* stars = Starshatter::GetInstance();
if (stars) {
KeyMap& keymap = stars->GetKeyMap();
keymap.Bind(KEY_AXIS_YAW, map_axis[0]+KEY_JOY_AXIS_X, 0);
keymap.Bind(KEY_AXIS_PITCH, map_axis[1]+KEY_JOY_AXIS_X, 0);
keymap.Bind(KEY_AXIS_ROLL, map_axis[2]+KEY_JOY_AXIS_X, 0);
keymap.Bind(KEY_AXIS_THROTTLE, map_axis[3]+KEY_JOY_AXIS_X, 0);
keymap.Bind(KEY_AXIS_YAW_INVERT, invert_checkbox[0]->GetButtonState(), 0);
keymap.Bind(KEY_AXIS_PITCH_INVERT, invert_checkbox[1]->GetButtonState(), 0);
keymap.Bind(KEY_AXIS_ROLL_INVERT, invert_checkbox[2]->GetButtonState(), 0);
keymap.Bind(KEY_AXIS_THROTTLE_INVERT, invert_checkbox[3]->GetButtonState(), 0);
keymap.SaveKeyMap("key.cfg", 256);
stars->MapKeys();
}
if (manager)
manager->ShowCtlDlg();
}
示例3: SetFocus
void
KeyDlg::Show()
{
FormWindow::Show();
Starshatter* stars = Starshatter::GetInstance();
if (stars) {
KeyMap& keymap = stars->GetKeyMap();
if (command)
command->SetText(keymap.DescribeAction(key_index));
if (current_key)
current_key->SetText(keymap.DescribeKey(key_index));
}
key_clear = false;
new_key->SetText("");
SetFocus();
}