Fixed mouse move bug. No idea why it has to be fixed,

but MacOS X seems to send incorect event states.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2001-11-23 17:14:00 +00:00
parent 30fc2c8ec0
commit 6264b550ad
4 changed files with 2712 additions and 2688 deletions

View File

@@ -1014,11 +1014,11 @@ void wxApp::MacDoOneEvent()
{
EventRecord event ;
long sleepTime = 1 ; // GetCaretTime() / 4 ;
long sleepTime = 1; // GetCaretTime() / 4 ;
if (WaitNextEvent(everyEvent, &event,sleepTime, s_macCursorRgn))
if (WaitNextEvent(everyEvent, &event, sleepTime, s_macCursorRgn))
{
MacHandleOneEvent( &event );
MacHandleOneEvent( &event );
}
else
{
@@ -1034,7 +1034,7 @@ void wxApp::MacDoOneEvent()
// repeaters
DeletePendingObjects() ;
DeletePendingObjects() ;
wxMacProcessNotifierAndPendingEvents() ;
}
@@ -1692,8 +1692,19 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
break ;
default:
{
if ( s_lastMouseDown == 0 )
ev->modifiers |= btnState ;
// if ( s_lastMouseDown == 0 )
// ev->modifiers |= btnState ;
// Calling GetNextEvent with a zero event mask will always
// pass back a null event. However, it fills the EventRecord
// with the state of the modifier keys. This is needed since
// the modifier state returned by WaitForNextEvent often is
// wrong mouse move events. The attempt above to correct this
// didn't always work (under OS X at least).
EventRecord tmp;
::GetNextEvent(0, &tmp);
ev->modifiers = tmp.modifiers;
wxWindow* win = wxFindWinFromMacWindow( window ) ;
if ( win )

View File

@@ -1014,11 +1014,11 @@ void wxApp::MacDoOneEvent()
{
EventRecord event ;
long sleepTime = 1 ; // GetCaretTime() / 4 ;
long sleepTime = 1; // GetCaretTime() / 4 ;
if (WaitNextEvent(everyEvent, &event,sleepTime, s_macCursorRgn))
if (WaitNextEvent(everyEvent, &event, sleepTime, s_macCursorRgn))
{
MacHandleOneEvent( &event );
MacHandleOneEvent( &event );
}
else
{
@@ -1034,7 +1034,7 @@ void wxApp::MacDoOneEvent()
// repeaters
DeletePendingObjects() ;
DeletePendingObjects() ;
wxMacProcessNotifierAndPendingEvents() ;
}
@@ -1692,8 +1692,19 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
break ;
default:
{
if ( s_lastMouseDown == 0 )
ev->modifiers |= btnState ;
// if ( s_lastMouseDown == 0 )
// ev->modifiers |= btnState ;
// Calling GetNextEvent with a zero event mask will always
// pass back a null event. However, it fills the EventRecord
// with the state of the modifier keys. This is needed since
// the modifier state returned by WaitForNextEvent often is
// wrong mouse move events. The attempt above to correct this
// didn't always work (under OS X at least).
EventRecord tmp;
::GetNextEvent(0, &tmp);
ev->modifiers = tmp.modifiers;
wxWindow* win = wxFindWinFromMacWindow( window ) ;
if ( win )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff