More mousewheel support

This commit is contained in:
Henrik Rydgard committed 2013-07-08 12:35:08 +02:00
1 parent d68c805430
commit f2e739992d
6 files changed
+39 -6

No files matched your search

+8 -2
View File
@@ -341,6 +341,12 @@ const KeyMap_IntStrPair key_names[] = {
{KEYCODE_NUMPAD_7, "Num7"},
{KEYCODE_NUMPAD_8, "Num8"},
{KEYCODE_NUMPAD_9, "Num9"},
{KEYCODE_EXT_MOUSEBUTTON_1, "MB1"},
{KEYCODE_EXT_MOUSEBUTTON_2, "MB2"},
{KEYCODE_EXT_MOUSEBUTTON_3, "MB3"},
{KEYCODE_EXT_MOUSEWHEEL_UP, "MWheelU"},
{KEYCODE_EXT_MOUSEWHEEL_DOWN, "MWheelD"},
};
const KeyMap_IntStrPair axis_names[] = {
@@ -355,10 +361,10 @@ const KeyMap_IntStrPair axis_names[] = {
{JOYSTICK_AXIS_ORIENTATION, "Orient"},
{JOYSTICK_AXIS_VSCROLL, "Vert Scroll"},
{JOYSTICK_AXIS_HSCROLL, "Horiz Scroll"},
{JOYSTICK_AXIS_Z, "Z Axis"},
{JOYSTICK_AXIS_Z, "Z Axis"}, // Also used as second stick X on many controllers - rename?
{JOYSTICK_AXIS_RX, "X Rotation"},
{JOYSTICK_AXIS_RY, "Y Rotation"},
{JOYSTICK_AXIS_RZ, "Z Rotation"},
{JOYSTICK_AXIS_RZ, "Z Rotation"}, // Also used as second stick Y on many controllers - rename?
{JOYSTICK_AXIS_HAT_X, "X HAT"},
{JOYSTICK_AXIS_HAT_Y, "Y HAT"},
{JOYSTICK_AXIS_LTRIGGER, "TriggerL"},
+6
View File
@@ -340,6 +340,12 @@ void MainScreen::CreateViews() {
rightColumnItems->Add(new Choice("Support PPSSPP"))->OnClick.Handle(this, &MainScreen::OnSupport);
}
void MainScreen::sendMessage(const char *message, const char *value) {
if (!strcmp(message, "boot")) {
screenManager()->switchScreen(new EmuScreen(value));
}
}
void DrawBackground(float alpha);
void MainScreen::DrawBackground(UIContext &dc) {
+1
View File
@@ -31,6 +31,7 @@ public:
protected:
virtual void CreateViews();
virtual void DrawBackground(UIContext &dc);
virtual void sendMessage(const char *message, const char *value);
private:
UI::EventReturn OnGameSelected(UI::EventParams &e);
+2 -2
View File
@@ -243,8 +243,8 @@ void MenuScreen::render() {
g_Config.Save();
screenManager()->switchScreen(new EmuScreen(fileName.toStdString()));
}
#elif _WIN32
MainWindow::BrowseAndBoot("");
//#elif _WIN32
// MainWindow::BrowseAndBoot("");
#else
FileSelectScreenOptions options;
options.allowChooseDirectory = true;
+21 -1
View File
@@ -12,6 +12,7 @@
#include "commctrl.h"
#include "input/input_state.h"
#include "input/keycodes.h"
#include "Core/Debugger/SymbolMap.h"
#include "Windows/OpenGLBase.h"
#include "Windows/Debugger/Debugger_Disasm.h"
@@ -403,7 +404,6 @@ namespace MainWindow
}
break;
// Actual touch! Unfinished
case WM_TOUCH:
@@ -500,6 +500,26 @@ namespace MainWindow
}
break;
// For some reason, need to catch this here rather than in DisplayProc.
case WM_MOUSEWHEEL:
{
int wheelDelta = (short)(wParam >> 16);
KeyInput key;
key.deviceId = DEVICE_ID_MOUSE;
if (wheelDelta < 0) {
key.keyCode = KEYCODE_EXT_MOUSEWHEEL_DOWN;
wheelDelta = -wheelDelta;
} else {
key.keyCode = KEYCODE_EXT_MOUSEWHEEL_UP;
}
// There's no separate keyup event for mousewheel events, let's pass them both together.
// This also means it really won't work great for key mapping :( Need to build a 1 frame delay or something.
key.flags = KEY_DOWN | KEY_UP | KEY_HASWHEELDELTA | (wheelDelta << 16);
NativeKey(key);
break;
}
case WM_COMMAND:
{
if (!EmuThread_Ready())
+1 -1
Submodule native updated: 57d3fa0134...28fb341cb2.