Skip to content

Commit

Permalink
使用mpv快捷键
Browse files Browse the repository at this point in the history
  • Loading branch information
Grayon committed Sep 23, 2017
1 parent 3c29b7a commit 7d928f5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Douyu/PlayerWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ - (void)keyDown:(NSEvent*)event {
}

switch( [event keyCode] ) {
case 25:{ // 9
[self handleKeyboardEvnet:event keyDown:YES];
break;
}
case 29:{ // 0
[self handleKeyboardEvnet:event keyDown:YES];
break;
}
case 53:{ // Esc key
[self toggleFullScreen:self];
break;
Expand All @@ -52,6 +44,7 @@ - (void)keyDown:(NSEvent*)event {
break;
}
default:{
[self handleKeyboardEvnet:event keyDown:YES];
break;
}
}
Expand All @@ -69,7 +62,6 @@ - (void)handleKeyboardEvnet:(NSEvent *)event keyDown:(BOOL)keyDown {
}
const char *keyState = keyDown?"keydown":"keyup";
NSString *str = [self stringByKeyEvent:event];

const char *args[] = {keyState, [str UTF8String], NULL};
mpv_command_async(vc.mpv, 0, args);
}
Expand Down

0 comments on commit 7d928f5

Please sign in to comment.