mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Updates kivy version:
- added support for right mouse button (desktop only) - corrected a problem with virtualenv in mkp4a.init
This commit is contained in:
parent
2983648a4c
commit
11aff68af1
2 changed files with 38 additions and 15 deletions
|
@ -17,7 +17,16 @@ echo '### install p4a'
|
||||||
|
|
||||||
if [[ $# == 0 ]]
|
if [[ $# == 0 ]]
|
||||||
then
|
then
|
||||||
python3 -m pip install -q --user python-for-android
|
if not python3 -m pip install -q --user python-for-android
|
||||||
|
then
|
||||||
|
echo "obviously inside a virtualenv, so omit --user"
|
||||||
|
if python3 -m pip install -q python-for-android
|
||||||
|
then
|
||||||
|
echo "done"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "done"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo '### prepare source'
|
echo '### prepare source'
|
||||||
|
|
|
@ -54,6 +54,10 @@ from kivy.utils import platform
|
||||||
|
|
||||||
from pysollib.kivy.androidperms import requestStoragePerm
|
from pysollib.kivy.androidperms import requestStoragePerm
|
||||||
|
|
||||||
|
from kivy.config import Config
|
||||||
|
if platform is not 'android':
|
||||||
|
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
@ -713,13 +717,27 @@ class LImageItem(BoxLayout, LBase):
|
||||||
# ev. noch globales cache für stacks->game und cards->stack
|
# ev. noch globales cache für stacks->game und cards->stack
|
||||||
# einrichten. Aber: stacks hängt vom jeweiligen spiel ab.
|
# einrichten. Aber: stacks hängt vom jeweiligen spiel ab.
|
||||||
|
|
||||||
def send_event_pressed_1(self, event):
|
def send_event_pressed_n(self, event, n):
|
||||||
if self.group and '<1>' in self.group.bindings:
|
if self.group and n in self.group.bindings:
|
||||||
self.group.bindings['<1>'](event)
|
self.group.bindings[n](event)
|
||||||
|
|
||||||
def send_event_pressed_double_1(self, event):
|
def send_event_pressed(self, touch, event):
|
||||||
if self.group and '<Double-1>' in self.group.bindings:
|
|
||||||
self.group.bindings['<Double-1>'](event)
|
if touch.is_double_tap:
|
||||||
|
self.send_event_pressed_n(event,'<Double-1>')
|
||||||
|
else:
|
||||||
|
button = 'left'
|
||||||
|
if 'button' in touch.profile:
|
||||||
|
button = touch.button
|
||||||
|
if button is 'left':
|
||||||
|
self.send_event_pressed_n(event,'<1>')
|
||||||
|
return
|
||||||
|
if button is 'middle':
|
||||||
|
self.send_event_pressed_n(event,'<2>')
|
||||||
|
return
|
||||||
|
if button is 'right':
|
||||||
|
self.send_event_pressed_n(event,'<3>')
|
||||||
|
return
|
||||||
|
|
||||||
def on_touch_down(self, touch):
|
def on_touch_down(self, touch):
|
||||||
|
|
||||||
|
@ -743,10 +761,7 @@ class LImageItem(BoxLayout, LBase):
|
||||||
event.y = ppos[1]
|
event.y = ppos[1]
|
||||||
self.dragstart = touch.pos
|
self.dragstart = touch.pos
|
||||||
event.cardid = i
|
event.cardid = i
|
||||||
if touch.is_double_tap:
|
self.send_event_pressed(touch,event)
|
||||||
self.send_event_pressed_double_1(event)
|
|
||||||
else:
|
|
||||||
self.send_event_pressed_1(event)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if self.group is not None:
|
if self.group is not None:
|
||||||
|
@ -1777,10 +1792,9 @@ class LApp(App):
|
||||||
|
|
||||||
def doSize(self, obj, val):
|
def doSize(self, obj, val):
|
||||||
mval = self.mainWindow.size
|
mval = self.mainWindow.size
|
||||||
|
if (val[0]!=mval[0] and val[1]!=mval[1]):
|
||||||
logging.info("LApp: size changed %s - %s (%s)" % (obj, val, mval))
|
logging.info("LApp: size changed %s - %s (%s)" % (obj, val, mval))
|
||||||
# Clock.schedule_once(self.delayedRebuild, 0.01)
|
|
||||||
Clock.schedule_once(self.makeDelayedRebuild(), 0.01)
|
Clock.schedule_once(self.makeDelayedRebuild(), 0.01)
|
||||||
# self.mainWindow.rebuildContainer()
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue