Loading core/fake_key_event.py +33 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,34 @@ qt_key_dict = { '''x''': Qt.Key_X, '''y''': Qt.Key_Y, '''z''': Qt.Key_Z, '''A''': Qt.Key_A, '''B''': Qt.Key_B, '''C''': Qt.Key_C, '''D''': Qt.Key_D, '''E''': Qt.Key_E, '''F''': Qt.Key_F, '''G''': Qt.Key_G, '''H''': Qt.Key_H, '''I''': Qt.Key_I, '''J''': Qt.Key_J, '''K''': Qt.Key_K, '''L''': Qt.Key_L, '''M''': Qt.Key_M, '''N''': Qt.Key_N, '''O''': Qt.Key_O, '''P''': Qt.Key_P, '''Q''': Qt.Key_Q, '''R''': Qt.Key_R, '''S''': Qt.Key_S, '''T''': Qt.Key_T, '''U''': Qt.Key_U, '''V''': Qt.Key_V, '''W''': Qt.Key_W, '''X''': Qt.Key_X, '''Y''': Qt.Key_Y, '''Z''': Qt.Key_Z, '''0''': Qt.Key_0, '''1''': Qt.Key_1, '''2''': Qt.Key_2, Loading Loading @@ -106,6 +134,11 @@ def fake_key_event(event_string, app_buffer): if event_string == "<backtab>": modifier = Qt.ShiftModifier if event_string.isupper() : modifier = Qt.ShiftModifier print("Press: ", event_string) # NOTE: don't ignore text argument, otherwise QWebEngineView not respond key event. key_press = QKeyEvent(QEvent.KeyPress, qt_key_dict[event_string], modifier, text) Loading docs/TODOLIST.md +0 −1 Original line number Diff line number Diff line ## Todo list * Core: support upper char event. * Browser: implement js plugin like vimium * Browser: study more code from https://github.com/LavaPower/Browthon-Old/blob/c25d5721b40e95131a3c521566a18467f13ecbf0/files/Browthon_elements.py * ImageViewer: add zoom support Loading eaf.el +35 −38 Original line number Diff line number Diff line Loading @@ -249,8 +249,7 @@ We need calcuate render allocation to make sure no black border around render co (let* ((file-or-command-name (substring input-content (string-match "[^\/]*\/?$" input-content))) (eaf-buffer (generate-new-buffer (truncate-string-to-width file-or-command-name eaf-title-length)))) (with-current-buffer eaf-buffer (eaf-mode) (read-only-mode)) (eaf-mode)) eaf-buffer)) (defun eaf-is-support (url) Loading Loading @@ -436,11 +435,9 @@ We need calcuate render allocation to make sure no black border around render co (let ((eaf-buffer (generate-new-buffer (concat "Browser Popup Window " new-window-buffer-id)))) (with-current-buffer eaf-buffer (eaf-mode) (read-only-mode) (set (make-local-variable 'buffer-id) new-window-buffer-id) (set (make-local-variable 'buffer-url) "") (set (make-local-variable 'buffer-app-name) "browser") ) (set (make-local-variable 'buffer-app-name) "browser")) (switch-to-buffer eaf-buffer))) (dbus-register-signal Loading Loading
core/fake_key_event.py +33 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,34 @@ qt_key_dict = { '''x''': Qt.Key_X, '''y''': Qt.Key_Y, '''z''': Qt.Key_Z, '''A''': Qt.Key_A, '''B''': Qt.Key_B, '''C''': Qt.Key_C, '''D''': Qt.Key_D, '''E''': Qt.Key_E, '''F''': Qt.Key_F, '''G''': Qt.Key_G, '''H''': Qt.Key_H, '''I''': Qt.Key_I, '''J''': Qt.Key_J, '''K''': Qt.Key_K, '''L''': Qt.Key_L, '''M''': Qt.Key_M, '''N''': Qt.Key_N, '''O''': Qt.Key_O, '''P''': Qt.Key_P, '''Q''': Qt.Key_Q, '''R''': Qt.Key_R, '''S''': Qt.Key_S, '''T''': Qt.Key_T, '''U''': Qt.Key_U, '''V''': Qt.Key_V, '''W''': Qt.Key_W, '''X''': Qt.Key_X, '''Y''': Qt.Key_Y, '''Z''': Qt.Key_Z, '''0''': Qt.Key_0, '''1''': Qt.Key_1, '''2''': Qt.Key_2, Loading Loading @@ -106,6 +134,11 @@ def fake_key_event(event_string, app_buffer): if event_string == "<backtab>": modifier = Qt.ShiftModifier if event_string.isupper() : modifier = Qt.ShiftModifier print("Press: ", event_string) # NOTE: don't ignore text argument, otherwise QWebEngineView not respond key event. key_press = QKeyEvent(QEvent.KeyPress, qt_key_dict[event_string], modifier, text) Loading
docs/TODOLIST.md +0 −1 Original line number Diff line number Diff line ## Todo list * Core: support upper char event. * Browser: implement js plugin like vimium * Browser: study more code from https://github.com/LavaPower/Browthon-Old/blob/c25d5721b40e95131a3c521566a18467f13ecbf0/files/Browthon_elements.py * ImageViewer: add zoom support Loading
eaf.el +35 −38 Original line number Diff line number Diff line Loading @@ -249,8 +249,7 @@ We need calcuate render allocation to make sure no black border around render co (let* ((file-or-command-name (substring input-content (string-match "[^\/]*\/?$" input-content))) (eaf-buffer (generate-new-buffer (truncate-string-to-width file-or-command-name eaf-title-length)))) (with-current-buffer eaf-buffer (eaf-mode) (read-only-mode)) (eaf-mode)) eaf-buffer)) (defun eaf-is-support (url) Loading Loading @@ -436,11 +435,9 @@ We need calcuate render allocation to make sure no black border around render co (let ((eaf-buffer (generate-new-buffer (concat "Browser Popup Window " new-window-buffer-id)))) (with-current-buffer eaf-buffer (eaf-mode) (read-only-mode) (set (make-local-variable 'buffer-id) new-window-buffer-id) (set (make-local-variable 'buffer-url) "") (set (make-local-variable 'buffer-app-name) "browser") ) (set (make-local-variable 'buffer-app-name) "browser")) (switch-to-buffer eaf-buffer))) (dbus-register-signal Loading