Skip to content

Commit

Permalink
[OSX] support CMD+v to paste clipboard text.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulion committed May 11, 2013
1 parent 2756e96 commit 21c42b2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xbmc/windowing/WinEventsSDL.cpp
Expand Up @@ -25,6 +25,7 @@
#include "WinEventsSDL.h"
#include "Application.h"
#include "ApplicationMessenger.h"
#include "GUIUserMessages.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/Key.h"
#ifdef HAS_SDL_JOYSTICK
Expand Down Expand Up @@ -418,6 +419,19 @@ bool CWinEventsSDL::ProcessOSXShortcuts(SDL_Event& event)
CApplicationMessenger::Get().Minimize();
return true;

case SDLK_v: // CMD-v to paste clipboard text
if (g_Windowing.IsTextInputEnabled())
{
const char *szStr = Cocoa_Paste();
if (szStr)
{
CGUIMessage msg(GUI_MSG_INPUT_TEXT, 0, 0);
msg.SetLabel(szStr);
g_windowManager.SendMessage(msg, g_windowManager.GetFocusedWindow());
}
}
return true;

default:
return false;
}
Expand Down

1 comment on commit 21c42b2

@davilla
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this

Please sign in to comment.