Change more places to check for Cmd key on Mac rather than Ctrl key.

Originally committed to SVN as r1574.
This commit is contained in:
Niels Martin Hansen 2007-09-21 22:56:44 +00:00
parent a353eaed38
commit 81aec949dc
8 changed files with 50 additions and 1 deletions

View File

@ -577,7 +577,11 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) {
// Modifiers
bool shift = event.m_shiftDown;
bool alt = event.m_altDown;
#ifdef __APPLE__
bool ctrl = event.m_metaDown;
#else
bool ctrl = event.m_controlDown;
#endif
// Row that mouse is over
bool click = event.ButtonDown(wxMOUSE_BTN_LEFT);
@ -952,7 +956,11 @@ void BaseGrid::OnKeyPress(wxKeyEvent &event) {
// Get scan code
int key = event.GetKeyCode();
#ifdef __APPLE__
bool ctrl = event.m_metaDown;
#else
bool ctrl = event.m_controlDown;
#endif
bool alt = event.m_altDown;
bool shift = event.m_shiftDown;

View File

@ -1154,7 +1154,11 @@ void DialogStyleManager::OnKeyDown(wxKeyEvent &event) {
case 'C' :
case 'c' :
#ifdef __APPLE__
if (event.CmdDown()) {
#else
if (event.ControlDown()) {
#endif
if (wxWindow::FindFocus()==CurrentList) {
CopyToClipboard(CurrentList,styleMap);
}
@ -1166,7 +1170,11 @@ void DialogStyleManager::OnKeyDown(wxKeyEvent &event) {
case 'V' :
case 'v' :
#ifdef __APPLE__
if (event.CmdDown()) {
#else
if (event.ControlDown()) {
#endif
if (wxWindow::FindFocus()==CurrentList) {
PasteToCurrent();
}

View File

@ -1006,7 +1006,11 @@ void FrameMain::OnOpenLog (wxCommandEvent &event) {
///////////////////
// Open Automation
void FrameMain::OnOpenAutomation (wxCommandEvent &event) {
#ifdef __APPLE__
if (wxGetMouseState().CmdDown()) {
#else
if (wxGetMouseState().ControlDown()) {
#endif
wxGetApp().global_scripts->Reload();
if (wxGetMouseState().ShiftDown()) {
const std::vector<Automation4::Script*> scripts = local_scripts->GetScripts();

View File

@ -824,7 +824,11 @@ void SubsEditBox::DoKeyPress(wxKeyEvent &event) {
if (key == WXK_RETURN || key == WXK_NUMPAD_ENTER) {
if (enabled) {
#ifdef __APPLE__
Commit(event.m_metaDown);
#else
Commit(event.m_controlDown);
#endif
return;
}
}
@ -1292,7 +1296,12 @@ void SubsEditBox::OnButtonStrikeout(wxCommandEvent &event) {
//////////
// Commit
void SubsEditBox::OnButtonCommit(wxCommandEvent &event) {
Commit(wxGetMouseState().ControlDown());
Commit(wxGetMouseState().
#ifdef __APPLE__
CmdDown());
#else
ControlDown());
#endif
}

View File

@ -233,7 +233,11 @@ void TimeEdit::OnKeyDown(wxKeyEvent &event) {
Refresh();
// Check if it's an acceptable key
#ifdef __APPLE__
if (!event.CmdDown()) {
#else
if (!event.ControlDown()) {
#endif
if (byFrame || !insertMode || (key != WXK_BACK && key != WXK_DELETE)) {
// Reset selection first, if necessary
if (!byFrame && insertMode) {

View File

@ -168,7 +168,11 @@ END_EVENT_TABLE()
// Play video
void VideoBox::OnVideoPlay(wxCommandEvent &event) {
VideoContext *ctx = VideoContext::Get();
#ifdef __APPLE__
ctx->EnableAudioSync(wxGetMouseState().CmdDown() == false);
#else
ctx->EnableAudioSync(wxGetMouseState().ControlDown() == false);
#endif
ctx->Play();
}
@ -177,7 +181,11 @@ void VideoBox::OnVideoPlay(wxCommandEvent &event) {
// Play video line
void VideoBox::OnVideoPlayLine(wxCommandEvent &event) {
VideoContext *ctx = VideoContext::Get();
#ifdef __APPLE__
ctx->EnableAudioSync(wxGetMouseState().CmdDown() == false);
#else
ctx->EnableAudioSync(wxGetMouseState().ControlDown() == false);
#endif
ctx->PlayLine();
}

View File

@ -247,7 +247,11 @@ void VideoSlider::OnKeyDown(wxKeyEvent &event) {
// Get flags
int key = event.GetKeyCode();
#ifdef __APPLE__
bool ctrl = event.m_metaDown;
#else
bool ctrl = event.m_controlDown;
#endif
bool alt = event.m_altDown;
bool shift = event.m_shiftDown;
int direction = 0;

View File

@ -128,7 +128,11 @@ void VisualTool::OnMouseEvent (wxMouseEvent &event) {
leftClick = event.ButtonDown(wxMOUSE_BTN_LEFT);
leftDClick = event.LeftDClick();
shiftDown = event.m_shiftDown;
#ifdef __APPLE__
ctrlDown = event.m_metaDown; // Cmd key
#else
ctrlDown = event.m_controlDown;
#endif
altDown = event.m_altDown;
// Drag a feature