Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b8d7e9

Browse filesBrowse files
committed
Fix to Kivy example: send mouse move events to CEF (Issue cztomczak#243)
1 parent 9756f7a commit 7b8d7e9
Copy full SHA for 7b8d7e9

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Collapse file

‎src/linux/binaries_64bit/kivy_.py‎

Copy file name to clipboardExpand all lines: src/linux/binaries_64bit/kivy_.py
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def _cef_mes(self, *kwargs):
132132
'''Get called every frame.
133133
'''
134134
cefpython.MessageLoopWork()
135+
self.on_mouse_move_emulate()
135136

136137

137138
def _update_rect(self, *kwargs):
@@ -541,6 +542,18 @@ def on_touch_down(self, touch, *kwargs):
541542
cefpython.MOUSEBUTTON_LEFT,
542543
mouseUp=False, clickCount=1)
543544

545+
last_mouse_pos = None
546+
def on_mouse_move_emulate(self):
547+
mouse_pos = self.get_root_window().mouse_pos
548+
if self.last_mouse_pos == mouse_pos:
549+
return
550+
self.last_mouse_pos = mouse_pos
551+
# Fix mouse pos: realy = 0, kivy y = 600 / realy = 600, kivy y = 0
552+
x = mouse_pos[0]
553+
y = int(mouse_pos[1]-self.height)
554+
if x >= 0 and y <= 0:
555+
y = abs(y)
556+
self.browser.SendMouseMoveEvent(x, y, mouseLeave=False)
544557

545558

546559
def on_touch_move(self, touch, *kwargs):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.