File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,20 @@ cdef public cpp_bool KeyboardHandler_OnKeyEvent(
9090 browser = pyBrowser,
9191 event = pyEvent,
9292 event_handle = < object > PyLong_FromVoidPtr(cefEventHandle))
93- return bool (returnValue)
93+ # If returnValue is False then handle copy/paste on Mac
94+ if returnValue:
95+ return bool (returnValue)
96+ if platform.system() == " Darwin" :
97+ # Handle copy: command + c
98+ if pyEvent[" modifiers" ] == 128 \
99+ and pyEvent[" native_key_code" ] == 8 :
100+ pyBrowser.GetFocusedFrame().Copy()
101+ return True
102+ # Handle paste: command + v
103+ elif pyEvent[" modifiers" ] == 128 \
104+ and pyEvent[" native_key_code" ] == 9 :
105+ pyBrowser.GetFocusedFrame().Paste()
106+ return True
94107 return False
95108 except :
96109 (exc_type, exc_value, exc_trace) = sys.exc_info()
You can’t perform that action at this time.
0 commit comments