pass by reference, not value
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2601,7 +2601,7 @@ this language feature but still take advantage of it when it is available.
|
|||||||
|
|
||||||
\membersection{::wxGetKeyState}\label{wxgetkeystate}
|
\membersection{::wxGetKeyState}\label{wxgetkeystate}
|
||||||
|
|
||||||
\func{bool}{wxGetKeyState}{\param{wxKeyCode }{key}}
|
\func{bool}{wxGetKeyState}{\param{const wxKeyCode\& }{key}}
|
||||||
|
|
||||||
Returns \true if the key parameter is currently pressed on the keyboard, or
|
Returns \true if the key parameter is currently pressed on the keyboard, or
|
||||||
with modifier keys, (caps lock, etc) if the key is active (the led light is
|
with modifier keys, (caps lock, etc) if the key is active (the led light is
|
||||||
|
@@ -101,7 +101,7 @@ WXDLLIMPEXP_BASE wxString wxGetDataDir();
|
|||||||
// Get the state of a key (true if pressed, false if not)
|
// Get the state of a key (true if pressed, false if not)
|
||||||
// This is generally most useful getting the state of
|
// This is generally most useful getting the state of
|
||||||
// the modifier or toggle keys.
|
// the modifier or toggle keys.
|
||||||
WXDLLEXPORT bool wxGetKeyState(wxKeyCode key);
|
WXDLLEXPORT bool wxGetKeyState(const wxKeyCode& key);
|
||||||
|
|
||||||
|
|
||||||
// Don't synthesize KeyUp events holding down a key and producing
|
// Don't synthesize KeyUp events holding down a key and producing
|
||||||
|
@@ -1177,7 +1177,7 @@ int wxMacKeyCodeToModifier(wxKeyCode key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below
|
bool wxGetKeyState(const wxKeyCode& key) //virtual key code if < 10.2.x, else see below
|
||||||
{
|
{
|
||||||
#ifdef __DARWIN__
|
#ifdef __DARWIN__
|
||||||
// Startup HID keyboard for getting key codes on DARWIN
|
// Startup HID keyboard for getting key codes on DARWIN
|
||||||
|
@@ -1851,17 +1851,10 @@ int wxKeyCodeToMacModifier(wxKeyCode key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below
|
bool wxGetKeyState(const wxKeyCode& key) //virtual key code if < 10.2.x, else see below
|
||||||
{
|
{
|
||||||
#if __WXMAC_CARBON__
|
#if __WXMAC_CARBON__
|
||||||
//#ifdef __DARWIN__
|
//TODO: Low get map...
|
||||||
// wxHIDKeyboard keyboard;
|
|
||||||
// return keyboard.IsActive(key);
|
|
||||||
//#else
|
|
||||||
// TODO: Have it use HID Manager on OSX...
|
|
||||||
//if OS X > 10.2 (i.e. 10.2.x)
|
|
||||||
//a known apple bug prevents the system from determining led
|
|
||||||
//states with GetKeys... can only determine caps lock led
|
|
||||||
return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key));
|
return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key));
|
||||||
#else
|
#else
|
||||||
KeyMap keymap;
|
KeyMap keymap;
|
||||||
|
@@ -5138,7 +5138,7 @@ int wxCharCodeWXToMSW(int id, bool *isVirtual)
|
|||||||
return keySym;
|
return keySym;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGetKeyState(wxKeyCode key)
|
bool wxGetKeyState(const wxKeyCode& key)
|
||||||
{
|
{
|
||||||
bool bVirtual;
|
bool bVirtual;
|
||||||
int vkey = wxCharCodeWXToMSW(key, &bVirtual);
|
int vkey = wxCharCodeWXToMSW(key, &bVirtual);
|
||||||
|
@@ -762,7 +762,7 @@ KeySym wxCharCodeWXToX(int id)
|
|||||||
|
|
||||||
#include <wx/app.h>
|
#include <wx/app.h>
|
||||||
|
|
||||||
bool wxGetKeyState(wxKeyCode key)
|
bool wxGetKeyState(const wxKeyCode& key)
|
||||||
{
|
{
|
||||||
#if defined(__WXX11__)
|
#if defined(__WXX11__)
|
||||||
Display *pDisplay = (Display*) wxApp::GetDisplay();
|
Display *pDisplay = (Display*) wxApp::GetDisplay();
|
||||||
|
Reference in New Issue
Block a user