Skip to content

Commit

Permalink
Merge pull request #1529 from pjrobertson/cmdv
Browse files Browse the repository at this point in the history
Improve ⌘V for non-latin keyboards
  • Loading branch information
skurfer committed Jul 12, 2013
2 parents 0599beb + 4c8367e commit e703f22
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -15,7 +15,11 @@

void QSForcePaste() {
CGKeyCode pasteKeyCode = [[NDKeyboardLayout keyboardLayout] keyCodeForCharacter:'v'];

if (pasteKeyCode == 0) {
// fall back to an assumed key code
pasteKeyCode = 0x9;
}

CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
CGEventSourceSetLocalEventsFilterDuringSuppressionState(source, kCGEventFilterMaskPermitLocalMouseEvents | kCGEventFilterMaskPermitSystemDefinedEvents,kCGEventSuppressionStateSuppressionInterval);
CGEventRef pasteCommandDown = CGEventCreateKeyboardEvent(source, pasteKeyCode, YES);
Expand Down

0 comments on commit e703f22

Please sign in to comment.