MCPcopy Create free account
hub / github.com/audacity/audacity / OnKeyDown

Method OnKeyDown

src/AudacityApp.cpp:1875–1898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1873}
1874
1875void AudacityApp::OnKeyDown(wxKeyEvent &event)
1876{
1877 if(event.GetKeyCode() == WXK_ESCAPE) {
1878 // Stop play, including scrub, but not record
1879 if ( auto project = ::GetActiveProject().lock() ) {
1880 auto token = ProjectAudioIO::Get( *project ).GetAudioIOToken();
1881 auto &scrubber = Scrubber::Get( *project );
1882 auto scrubbing = scrubber.HasMark();
1883 if (scrubbing)
1884 scrubber.Cancel();
1885 auto gAudioIO = AudioIO::Get();
1886 if((token > 0 &&
1887 gAudioIO->IsAudioTokenActive(token) &&
1888 gAudioIO->GetNumCaptureChannels() == 0) ||
1889 scrubbing)
1890 // ESC out of other play (but not record)
1891 ProjectAudioManager::Get( *project ).Stop();
1892 else
1893 event.Skip();
1894 }
1895 }
1896
1897 event.Skip();
1898}
1899
1900// Ensures directory is created and puts the name into result.
1901// result is unchanged if unsuccessful.

Callers

nothing calls this directly

Calls 7

GetFunction · 0.85
GetAudioIOTokenMethod · 0.80
IsAudioTokenActiveMethod · 0.80
SkipMethod · 0.80
lockMethod · 0.45
CancelMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected