From 95b8d129508ccdec5eadabf46eb313b49a6b4369 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 9 May 2019 23:11:05 +0100 Subject: implement windows clipboard functionality This allows clipboard to operate (cut, copy, paste and delete) in the win32 front end. The clipboard is set and read in windows unicode mode and then converted to/from utf-8 for the browser core. --- frontends/windows/drawable.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'frontends/windows/drawable.c') diff --git a/frontends/windows/drawable.c b/frontends/windows/drawable.c index f491e0a2a..939f4f946 100644 --- a/frontends/windows/drawable.c +++ b/frontends/windows/drawable.c @@ -581,6 +581,29 @@ nsws_window_drawable_event_callback(HWND hwnd, case WM_MOUSEWHEEL: return nsws_drawable_wheel(gw, hwnd, wparam); + case WM_PASTE: + browser_window_key_press(gw->bw, NS_KEY_PASTE); + return 0; + + case WM_COPY: + browser_window_key_press(gw->bw, NS_KEY_COPY_SELECTION); + return 0; + + case WM_CUT: + browser_window_key_press(gw->bw, NS_KEY_CUT_SELECTION); + return 0; + + case WM_CLEAR: + /** + * \todo win32 clear operation deletes the contents of + * the selection but ns clear selection only + * removes the highlight. + */ + browser_window_key_press(gw->bw, NS_KEY_CLEAR_SELECTION); + return 0; + + + } return DefWindowProc(hwnd, msg, wparam, lparam); } -- cgit v1.2.3