Browse Source

windisplay: add config var to disable Ctrl+V behaviour

Fixes #512
rdb 6 years ago
parent
commit
0568312324

+ 5 - 0
panda/src/windisplay/config_windisplay.cxx

@@ -86,6 +86,11 @@ ConfigVariableBool swapbuffer_framelock
 ("swapbuffer-framelock", false,
  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
  * the functions or classes in this library can be used.  Normally it will be

+ 1 - 0
panda/src/windisplay/config_windisplay.h

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

+ 1 - 1
panda/src/windisplay/winGraphicsWindow.cxx

@@ -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
       // this hotkey?
       if ((wparam=='V') && (GetKeyState(VK_CONTROL) < 0) &&
-          !_input_devices.empty()) {
+          !_input_devices.empty() && paste_emit_keystrokes) {
         HGLOBAL hglb;
         char *lptstr;