- 3rd mouse button now supported by the wx display library
- CTRL key + 3rd (middle) mouse button now toggles the mouse (F12 key is now usable in the guest OS) - initial comments fixed
This commit is contained in:
parent
ee8d40c11d
commit
16c5bc8786
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// $Id: wx.cc,v 1.66 2004-02-10 20:30:14 vruppert Exp $
|
||||
// $Id: wx.cc,v 1.67 2004-02-15 12:40:06 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// wxWindows VGA display for Bochs. wx.cc implements a custom
|
||||
@ -10,7 +10,7 @@
|
||||
//
|
||||
// The separation between wxmain.cc and wx.cc is as follows:
|
||||
// - wxmain.cc implements a Bochs configuration interface (CI),
|
||||
// which is the wxWindows equivalent of control.cc. wxmain creates
|
||||
// which is the wxWindows equivalent of textconfig.cc. wxmain creates
|
||||
// a frame with several menus and a toolbar, and allows the user to
|
||||
// choose the machine configuration and start the simulation. Note
|
||||
// that wxmain.cc does NOT include bochs.h. All interactions
|
||||
@ -184,7 +184,7 @@ void MyPanel::ToggleMouse (bool fromToolbar)
|
||||
wxString msg =
|
||||
"You have enabled the mouse in Bochs, so now your mouse actions will\n"
|
||||
"be sent into the simulator. The usual mouse cursor will be trapped\n"
|
||||
"inside the Bochs window until you press F12 or press the middle button\n"
|
||||
"inside the Bochs window until you press a CTRL key + the middle button\n"
|
||||
"to turn mouse capture off.";
|
||||
wxMessageBox(msg, "Mouse Capture Enabled", wxOK | wxICON_INFORMATION);
|
||||
first_enable = false;
|
||||
@ -220,7 +220,7 @@ void MyPanel::OnMouse(wxMouseEvent& event)
|
||||
}
|
||||
)
|
||||
|
||||
if (event.MiddleDown ()) {
|
||||
if (event.MiddleDown () && event.ControlDown ()) {
|
||||
ToggleMouse (false);
|
||||
return;
|
||||
}
|
||||
@ -232,6 +232,7 @@ void MyPanel::OnMouse(wxMouseEvent& event)
|
||||
Bit32u buttons;
|
||||
buttons = event.LeftIsDown () ? 1 : 0;
|
||||
buttons |= event.RightIsDown () ? 2 : 0;
|
||||
buttons |= event.MiddleIsDown () ? 4 : 0;
|
||||
if (x==mouseSavedX && y==mouseSavedY && !event.IsButton ()) {
|
||||
// nothing happened. This could have been generated by the WarpPointer.
|
||||
return;
|
||||
@ -271,10 +272,6 @@ MyPanel::MyRefresh ()
|
||||
|
||||
void MyPanel::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
if(event.GetKeyCode() == WXK_F12) {
|
||||
ToggleMouse (false);
|
||||
return;
|
||||
}
|
||||
wxCriticalSectionLocker lock(event_thread_lock);
|
||||
if(num_events < MAX_EVENTS) {
|
||||
event_queue[num_events].type = BX_ASYNC_EVT_KEY;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// $Id: wxmain.cc,v 1.102 2004-02-10 20:30:14 vruppert Exp $
|
||||
// $Id: wxmain.cc,v 1.103 2004-02-15 12:40:06 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
|
||||
@ -16,7 +16,7 @@
|
||||
//
|
||||
// The separation between wxmain.cc and wx.cc is as follows:
|
||||
// - wxmain.cc implements a Bochs configuration interface (CI),
|
||||
// which is the wxWindows equivalent of control.cc. wxmain creates
|
||||
// which is the wxWindows equivalent of textconfig.cc. wxmain creates
|
||||
// a frame with several menus and a toolbar, and allows the user to
|
||||
// choose the machine configuration and start the simulation. Note
|
||||
// that wxmain.cc does NOT include bochs.h. All interactions
|
||||
@ -500,7 +500,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
// Omit config button because the whole wxWindows interface is like
|
||||
// one really big config button.
|
||||
//BX_ADD_TOOL(ID_Toolbar_Config, configbutton_xpm, "Runtime Configuration");
|
||||
BX_ADD_TOOL(ID_Toolbar_Mouse_en, mouse_xpm, "Enable/disable mouse capture\nThere are also two shortcuts for this: F12 and the middle mouse button.");
|
||||
BX_ADD_TOOL(ID_Toolbar_Mouse_en, mouse_xpm, "Enable/disable mouse capture\nThere is also a shortcut for this: a CTRL key + the middle mouse button.");
|
||||
BX_ADD_TOOL(ID_Toolbar_User, userbutton_xpm, "Keyboard shortcut");
|
||||
|
||||
tb->Realize();
|
||||
|
Loading…
Reference in New Issue
Block a user