Skip to content

Commit de1857b

Browse files
committed
Make mutlitouch sim enabled by default and add multitouch_on_demand to config to disable it.
1 parent 951f137 commit de1857b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

kivy/input/providers/mouse.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@
3333
will emulate multi-touch. If the touch has been initiated in the above manner
3434
(e.g. right mouse button), multitouch_sim will be added to touch's profile,
3535
and property `multitouch_sim` to the touch. By default `multitouch_sim` is
36-
False. If before mouse release (e.g. in on_touch_down/move) `multitouch_sim`
36+
True and multitouch will be emulated for that touch. However, if
37+
`multitouch_on_demand` is added to the config::
38+
39+
[input]
40+
mouse = mouse,multitouch_on_demand
41+
42+
then `multitouch_sim` defaults to `False`. In that case, if before mouse
43+
release (e.g. in on_touch_down/move) `multitouch_sim`
3744
is set to True, the touch will simulate multi-touch. For example::
3845
3946
if 'multitouch_sim' in touch.profile:
@@ -124,6 +131,7 @@ def __init__(self, device, args):
124131
self.alt_touch = None
125132
self.disable_on_activity = False
126133
self.disable_multitouch = False
134+
self.multitouch_on_demenad = False
127135

128136
# split arguments
129137
args = args.split(',')
@@ -135,6 +143,8 @@ def __init__(self, device, args):
135143
self.disable_on_activity = True
136144
elif arg == 'disable_multitouch':
137145
self.disable_multitouch = True
146+
elif arg == 'multitouch_on_demand':
147+
self.multitouch_on_demenad = True
138148
else:
139149
Logger.error('Mouse: unknown parameter <%s>' % arg)
140150

@@ -183,7 +193,7 @@ def create_touch(self, rx, ry, is_double_tap, do_graphics, button):
183193
id = 'mouse' + str(self.counter)
184194
args = [rx, ry, button]
185195
if do_graphics:
186-
args += [False]
196+
args += [not self.multitouch_on_demenad]
187197
self.current_drag = cur = MouseMotionEvent(self.device, id=id,
188198
args=args)
189199
cur.is_double_tap = is_double_tap

0 commit comments

Comments
 (0)