No changes, just use more clear variable name ("keycode" instead of "id") and
anonymous namespace instead of static keyword.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65513
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// WM_KEYDOWN one
bool wxWindowMSW::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
{
// WM_KEYDOWN one
bool wxWindowMSW::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
{
}
else // we're called from WM_KEYDOWN
{
// don't pass lParam to wxCharCodeMSWToWX() here because we don't want
// to get numpad key codes: CHAR events should use the logical keys
// such as WXK_HOME instead of WXK_NUMPAD_HOME which is for KEY events
}
else // we're called from WM_KEYDOWN
{
// don't pass lParam to wxCharCodeMSWToWX() here because we don't want
// to get numpad key codes: CHAR events should use the logical keys
// such as WXK_HOME instead of WXK_NUMPAD_HOME which is for KEY events
- id = wxCharCodeMSWToWX(wParam);
- if ( id == 0 )
+ keycode = wxCharCodeMSWToWX(wParam);
+ if ( keycode == 0 )
{
// it's ASCII and will be processed here only when called from
// WM_CHAR (i.e. when isASCII = true), don't process it now
{
// it's ASCII and will be processed here only when called from
// WM_CHAR (i.e. when isASCII = true), don't process it now
- wxKeyEvent event(CreateKeyEvent(wxEVT_CHAR, id, lParam, wParam));
+ wxKeyEvent event(CreateKeyEvent(wxEVT_CHAR, keycode, lParam, wParam));
// the alphanumeric keys produced by pressing AltGr+something on European
// keyboards have both Ctrl and Alt modifiers which may confuse the user
// the alphanumeric keys produced by pressing AltGr+something on European
// keyboards have both Ctrl and Alt modifiers which may confuse the user
// KEY_DOWN event would still have the correct modifiers if they're really
// needed)
if ( event.m_controlDown && event.m_altDown &&
// KEY_DOWN event would still have the correct modifiers if they're really
// needed)
if ( event.m_controlDown && event.m_altDown &&
- (id >= 32 && id < 256) )
+ (keycode >= 32 && keycode < 256) )
{
event.m_controlDown =
event.m_altDown = false;
{
event.m_controlDown =
event.m_altDown = false;
// the_font.ReleaseResource();
}
// the_font.ReleaseResource();
}
// use the "extended" bit (24) of lParam to distinguish extended keys
// from normal keys as the same key is sent
// use the "extended" bit (24) of lParam to distinguish extended keys
// from normal keys as the same key is sent
int ChooseNormalOrExtended(int lParam, int keyNormal, int keyExtended)
{
// except that if lParam is 0, it means we don't have real lParam from
int ChooseNormalOrExtended(int lParam, int keyNormal, int keyExtended)
{
// except that if lParam is 0, it means we don't have real lParam from
//
// note that keys having a normal and numpad version (e.g. WXK_HOME and
// WXK_NUMPAD_HOME) are not included in this table as the mapping is not 1-to-1
//
// note that keys having a normal and numpad version (e.g. WXK_HOME and
// WXK_NUMPAD_HOME) are not included in this table as the mapping is not 1-to-1
-static const struct wxKeyMapping
+const struct wxKeyMapping
#endif // VK_APPS defined
};
#endif // VK_APPS defined
};
+} // anonymous namespace
+
// Returns 0 if was a normal ASCII value, not a special key. This indicates that
// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
int wxCharCodeMSWToWX(int vk, WXLPARAM lParam)
// Returns 0 if was a normal ASCII value, not a special key. This indicates that
// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
int wxCharCodeMSWToWX(int vk, WXLPARAM lParam)