1717import time
1818import re
1919import uuid
20+ import platform
2021
2122# Which method to use for message loop processing.
2223# EVT_IDLE - wx application has priority (default)
@@ -198,9 +199,9 @@ def OnTitleChange(self, browser, title):
198199 print ("ClientHandler::OnTitleChange()" )
199200 print ("title = %s" % title )
200201
201- def OnTooltip (self , browser , text ):
202+ def OnTooltip (self , browser , textOut ):
202203 print ("ClientHandler::OnTooltip()" )
203- print ("text = %s" )
204+ print ("text = %s" % textOut [ 0 ] )
204205 # OnTooltip seems not to work on Linux, reported bug on the CEF forum:
205206 # http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10898
206207
@@ -214,6 +215,22 @@ def OnConsoleMessage(self, browser, message, source, line):
214215 print ("source = %s" % source )
215216 print ("line = %s" % line )
216217
218+ # -------------------------------------------------------------------------
219+ # KeyboardHandler
220+ # -------------------------------------------------------------------------
221+ def OnPreKeyEvent (self , browser , event , eventHandle ,
222+ isKeyboardShortcutOut ):
223+ print ("ClientHandler::OnPreKeyEvent()" )
224+
225+ def OnKeyEvent (self , browser , event , eventHandle ):
226+ print ("ClientHandler::OnKeyEvent()" )
227+ print ("native_key_code = %s" % event ["native_key_code" ])
228+ if platform .system () == "Linux" :
229+ # F5 = 71
230+ if event ["native_key_code" ] == 71 :
231+ print ("F5 pressed! Reloading page.." )
232+ browser .ReloadIgnoreCache ()
233+
217234class MyApp (wx .App ):
218235 timer = None
219236 timerID = 1
0 commit comments