adapt defines for ctrl/command key
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -307,7 +307,7 @@ wxString wxAcceleratorEntry::ToString() const
|
||||
int flags = GetFlags();
|
||||
if ( flags & wxACCEL_ALT )
|
||||
text += _("Alt+");
|
||||
if ( flags & (wxACCEL_CTRL | wxACCEL_CMD) )
|
||||
if ( flags & wxACCEL_CTRL )
|
||||
text += _("Ctrl+");
|
||||
if ( flags & wxACCEL_SHIFT )
|
||||
text += _("Shift+");
|
||||
|
@@ -93,10 +93,10 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
|
||||
{
|
||||
wxAcceleratorEntry *entry = node->GetData();
|
||||
if ((event.m_keyCode == entry->GetKeyCode()) &&
|
||||
(((entry->GetFlags() & wxACCEL_CTRL) != 0) == event.ControlDown()) &&
|
||||
(((entry->GetFlags() & wxACCEL_RAW_CTRL) != 0) == event.ControlDown()) &&
|
||||
(((entry->GetFlags() & wxACCEL_SHIFT) != 0) == event.ShiftDown()) &&
|
||||
(((entry->GetFlags() & wxACCEL_ALT) != 0) == event.AltDown()) &&
|
||||
(((entry->GetFlags() & wxACCEL_CMD) != 0) == event.CmdDown()))
|
||||
(((entry->GetFlags() & wxACCEL_CTRL) != 0) == event.CmdDown()))
|
||||
{
|
||||
return entry->GetCommand();
|
||||
}
|
||||
|
@@ -137,6 +137,9 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry*
|
||||
if (entry->GetFlags() & wxACCEL_CTRL)
|
||||
modifiers |= NSCommandKeyMask;
|
||||
|
||||
if (entry->GetFlags() & wxACCEL_RAW_CTRL)
|
||||
modifiers |= NSControlKeyMask;
|
||||
|
||||
if (entry->GetFlags() & wxACCEL_ALT)
|
||||
modifiers |= NSAlternateKeyMask ;
|
||||
|
||||
|
@@ -80,7 +80,7 @@ wxDialog::~wxDialog()
|
||||
// about it
|
||||
bool wxDialog::IsEscapeKey(const wxKeyEvent& event)
|
||||
{
|
||||
if ( event.GetKeyCode() == '.' && event.GetModifiers() == wxMOD_CMD )
|
||||
if ( event.GetKeyCode() == '.' && event.GetModifiers() == wxMOD_CONTROL )
|
||||
return true;
|
||||
|
||||
return wxDialogBase::IsEscapeKey(event);
|
||||
|
@@ -339,7 +339,7 @@ void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)
|
||||
|
||||
void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
if ( event.GetModifiers() == wxMOD_CMD )
|
||||
if ( event.GetModifiers() == wxMOD_CONTROL )
|
||||
{
|
||||
switch( event.GetKeyCode() )
|
||||
{
|
||||
|
@@ -2667,9 +2667,9 @@ bool wxWindowMac::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
|
||||
mac_modifiers |= optionKey;
|
||||
if ( modifiers & wxMOD_SHIFT )
|
||||
mac_modifiers |= shiftKey;
|
||||
if ( modifiers & wxMOD_CONTROL )
|
||||
if ( modifiers & wxMOD_RAW_CONTROL )
|
||||
mac_modifiers |= controlKey;
|
||||
if ( modifiers & wxMOD_META )
|
||||
if ( modifiers & wxMOD_CONTROL )
|
||||
mac_modifiers |= cmdKey;
|
||||
|
||||
EventHotKeyRef hotKeyRef;
|
||||
|
Reference in New Issue
Block a user