--- nono/wx/wxmainview.h 2026/04/29 17:04:28 1.1.1.1 +++ nono/wx/wxmainview.h 2026/04/29 17:04:30 1.1.1.2 @@ -23,6 +23,11 @@ class WXMainView // 現在のスケール (wxapp が初期値を指定するため static 変数にしてある) static double screen_scale; + // マウスモードを設定 + void SetMouseMode(bool enable); + // マウスモードを取得 (キャプチャされているなら true) + bool GetMouseMode() const { return mousemode; } + private: void OnPaint(wxPaintEvent& event); @@ -30,6 +35,7 @@ class WXMainView void OnKeyDown(wxKeyEvent& event); void OnKeyUp(wxKeyEvent& event); + void OnMouse(wxMouseEvent& event); // 裏バッファ。 // VM がレンダリングするバッファ。 @@ -52,6 +58,15 @@ class WXMainView static const int keycode_table[0x80]; #endif + // マウスモード (キャプチャしていれば true) + bool mousemode = false; + // 前回のマウス座標 + wxPoint prevpos {}; + // WarpPointer() による移動検出用 + bool motion_by_warp_pointer = false; + // マウスカーソルを移動させる + void MyWarpPointer(wxSize pos); + wxTimer paintTimer; std::atomic paintRequested {}; void OnTimer(wxTimerEvent& event);