dolphin/Source/PluginSpecs/pluginspecs_wiimote.h
Soren Jorvang 5c335a8c85 Fixed WXKeyToString which had several problems, mostly just to get
hotkey configuration working with wx 2.9, but it turned out to be
too tempting to use it to hack up OS X keyboard support using wx
key events in the "old" input plugins.

It was with some reluctance that I used PAD_Input (and copied it
for Wiimote as well) as that is clearly a deprecated interface,
but this way the hack is contained within the old plugins for when
the switchover to ControllerInterface happens.

The idea is to provide stable keyboard support on OS X for both
GCPad and Wiimote while we debug HID keyboard and real 'mote code.

It works pretty well, although the wx approach does impose a few
limitations like no arrow keys and left/right side modifier keys
are considered equivalent.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5622 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-05 19:03:37 +00:00

84 lines
2.6 KiB
C

//__________________________________________________________________________________________________
// Common wiimote plugin spec, unversioned
//
#ifndef _WIIMOTE_H_INCLUDED__
#define _WIIMOTE_H_INCLUDED__
#include "PluginSpecs.h"
#include "ExportProlog.h"
#ifndef _WIN32
#include "Config.h"
#endif
typedef void (*TLogv)(const char* _pMessage, int _v);
// This is called when the Wiimote sends input reports to the Core.
// Payload: an L2CAP packet.
typedef void (*TWiimoteInterruptChannel)(int _number, u16 _channelID, const void* _pData, u32 _Size);
typedef bool (*TRendererHasFocus)(void);
// This data is passed from the core on initialization.
typedef struct
{
HWND hWnd;
#if defined HAVE_X11 && HAVE_X11
void *pXWindow;
#endif
u32 ISOId;
TLogv pLog;
TWiimoteInterruptChannel pWiimoteInterruptChannel;
TRendererHasFocus pRendererHasFocus;
} SWiimoteInitialize;
// I N T E R F A C E
// __________________________________________________________________________________________________
// Function: Wiimote_Output
// Purpose: An L2CAP packet is passed from the Core to the Wiimote,
// on the HID CONTROL channel.
// input: Da pakket.
// output: none
//
EXPORT void CALL Wiimote_ControlChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
// __________________________________________________________________________________________________
// Function: Send keyboard input to the plugin
// Purpose:
// input: The key and if it's pressed or released
// output: None
//
EXPORT void CALL Wiimote_Input(u16 _Key, u8 _UpDown);
// __________________________________________________________________________________________________
// Function: Wiimote_InterruptChannel
// Purpose: An L2CAP packet is passed from the Core to the Wiimote,
// on the HID INTERRUPT channel.
// input: Da pakket.
// output: none
//
EXPORT void CALL Wiimote_InterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
// __________________________________________________________________________________________________
// Function: Wiimote_Update
// Purpose: This function is called periodically by the Core.
// input: none
// output: none
//
EXPORT void CALL Wiimote_Update(int _number);
// __________________________________________________________________________________________________
// Function: PAD_GetAttachedPads
// Purpose: Get mask of attached pads (eg: controller 1 & 4 -> 0x9)
// input: none
// output: number of pads
//
EXPORT unsigned int CALL Wiimote_GetAttachedControllers();
#include "ExportEpilog.h"
#endif //_WIIMOTE_H_INCLUDED__