full keyboard access support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1256,14 +1256,22 @@ void wxWindowMac::MacSetBackgroundBrush( const wxBrush &brush )
|
|||||||
|
|
||||||
bool wxWindowMac::MacCanFocus() const
|
bool wxWindowMac::MacCanFocus() const
|
||||||
{
|
{
|
||||||
// there is currently no way to determine whether the window is running in full keyboard
|
// TODO : evaluate performance hits by looking up this value, eventually cache the results for a 1 sec or so
|
||||||
// access mode, therefore we cannot rely on these features, yet the only other way would be
|
// CAUTION : the value returned currently is 0 or 2, I've also found values of 1 having the same meaning, but the value range
|
||||||
// to issue a SetKeyboardFocus event and verify after whether it succeeded, this would risk problems
|
// is nowhere documented
|
||||||
// in event handlers...
|
Boolean keyExistsAndHasValidFormat ;
|
||||||
UInt32 features = 0 ;
|
CFIndex fullKeyboardAccess = CFPreferencesGetAppIntegerValue ( CFSTR("AppleKeyboardUIMode" ) ,
|
||||||
m_peer->GetFeatures( &features ) ;
|
kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
|
||||||
|
|
||||||
|
if ( keyExistsAndHasValidFormat && fullKeyboardAccess > 0 )
|
||||||
|
return true ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UInt32 features = 0 ;
|
||||||
|
m_peer->GetFeatures( &features ) ;
|
||||||
|
|
||||||
return features & ( kControlSupportsFocus | kControlGetsFocusOnClick ) ;
|
return features & ( kControlSupportsFocus | kControlGetsFocusOnClick ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::SetFocus()
|
void wxWindowMac::SetFocus()
|
||||||
|
Reference in New Issue
Block a user