Keybord support Added

* Implemented 'cellKb*' functions from 'sys_io' module, which are part
of the libkb library.

* Added corresponding entries in the 'Config > Settings' menu to change
the handler of the keyboard. Supported handlers: Windows, Null.

INFO: This keyboard library is *very* experimental and I am aware of
some bugs. There will be improvements soon.
This commit is contained in:
Alexandro Sánchez Bach 2013-09-11 22:49:49 +02:00
parent aea7f4aa77
commit 4835ae35af
15 changed files with 771 additions and 32 deletions

View file

@ -284,14 +284,16 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
wxStaticBoxSizer* s_round_gs_res( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Default resolution") ) );
wxStaticBoxSizer* s_round_gs_aspect( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Default aspect ratio") ) );
wxStaticBoxSizer* s_round_pad( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Pad") ) );
wxStaticBoxSizer* s_round_pad_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Handler") ) );
wxStaticBoxSizer* s_round_pad( new wxStaticBoxSizer( wxVERTICAL, &diag, _("IO") ) );
wxStaticBoxSizer* s_round_pad_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Pad Handler") ) );
wxStaticBoxSizer* s_round_keyboard_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Keyboard Handler") ) );
wxComboBox* cbox_cpu_decoder = new wxComboBox(&diag, wxID_ANY);
wxComboBox* cbox_gs_render = new wxComboBox(&diag, wxID_ANY);
wxComboBox* cbox_gs_resolution = new wxComboBox(&diag, wxID_ANY);
wxComboBox* cbox_gs_aspect = new wxComboBox(&diag, wxID_ANY);
wxComboBox* cbox_pad_handler = new wxComboBox(&diag, wxID_ANY);
wxComboBox* cbox_keyboard_handler = new wxComboBox(&diag, wxID_ANY);
wxCheckBox* chbox_gs_vsync = new wxCheckBox(&diag, wxID_ANY, "VSync");
@ -315,6 +317,10 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_pad_handler->Append("Windows");
//cbox_pad_handler->Append("DirectInput");
cbox_keyboard_handler->Append("Null");
cbox_keyboard_handler->Append("Windows");
//cbox_pad_handler->Append("DirectInput");
chbox_gs_vsync->SetValue(Ini.GSVSyncEnable.GetValue());
cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0);
@ -322,6 +328,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_gs_resolution->SetSelection(ResolutionIdToNum(Ini.GSResolution.GetValue()) - 1);
cbox_gs_aspect->SetSelection(Ini.GSAspectRatio.GetValue() - 1);
cbox_pad_handler->SetSelection(Ini.PadHandlerMode.GetValue());
cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue());
s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
@ -335,7 +342,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
s_round_gs->Add(chbox_gs_vsync, wxSizerFlags().Border(wxALL, 5));
s_round_pad_handler->Add(cbox_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_keyboard_handler->Add(cbox_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_pad->Add(s_round_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_pad->Add(s_round_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand());
wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL));
@ -359,6 +368,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1);
Ini.GSVSyncEnable.SetValue(chbox_gs_vsync->GetValue());
Ini.PadHandlerMode.SetValue(cbox_pad_handler->GetSelection());
Ini.KeyboardHandlerMode.SetValue(cbox_keyboard_handler->GetSelection());
Ini.Save();
}