windisplay: add config var to disable Ctrl+V behaviour

Fixes #512
This commit is contained in:
rdb 2019-05-03 19:41:27 +02:00
parent 54c6eaeb96
commit 0568312324
3 changed files with 7 additions and 1 deletions

View File

@ -86,6 +86,11 @@ ConfigVariableBool swapbuffer_framelock
("swapbuffer-framelock", false, ("swapbuffer-framelock", false,
PRC_DESC("Set this true to enable HW swapbuffer frame-lock on 3dlabs cards")); PRC_DESC("Set this true to enable HW swapbuffer frame-lock on 3dlabs cards"));
ConfigVariableBool paste_emit_keystrokes
("paste-emit-keystrokes", true,
PRC_DESC("Handle paste events (Ctrl-V) as separate keystroke events for each "
"pasted character."));
/** /**
* Initializes the library. This must be called at least once before any of * Initializes the library. This must be called at least once before any of
* the functions or classes in this library can be used. Normally it will be * the functions or classes in this library can be used. Normally it will be

View File

@ -31,6 +31,7 @@ extern ConfigVariableBool ime_hide;
extern ConfigVariableBool request_dxdisplay_information; extern ConfigVariableBool request_dxdisplay_information;
extern ConfigVariableBool dpi_aware; extern ConfigVariableBool dpi_aware;
extern ConfigVariableBool dpi_window_resize; extern ConfigVariableBool dpi_window_resize;
extern ConfigVariableBool paste_emit_keystrokes;
extern EXPCL_PANDAWIN ConfigVariableBool swapbuffer_framelock; extern EXPCL_PANDAWIN ConfigVariableBool swapbuffer_framelock;

View File

@ -1927,7 +1927,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
// Handle Cntrl-V paste from clipboard. Is there a better way to detect // Handle Cntrl-V paste from clipboard. Is there a better way to detect
// this hotkey? // this hotkey?
if ((wparam=='V') && (GetKeyState(VK_CONTROL) < 0) && if ((wparam=='V') && (GetKeyState(VK_CONTROL) < 0) &&
!_input_devices.empty()) { !_input_devices.empty() && paste_emit_keystrokes) {
HGLOBAL hglb; HGLOBAL hglb;
char *lptstr; char *lptstr;