mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
includes ts_uinput_touch daemon which translates tslib events to uinput includes belonging touchscreen calibration addon
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
################################################################################
|
|
# This file is part of LibreELEC - https://libreelec.tv
|
|
# Copyright (C) 2016 Team LibreELEC
|
|
#
|
|
# LibreELEC is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# LibreELEC is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
|
################################################################################
|
|
|
|
import xbmc
|
|
import xbmcgui
|
|
import xbmcaddon
|
|
|
|
__scriptid__ = 'service.touchscreen'
|
|
__addon__ = xbmcaddon.Addon(id=__scriptid__)
|
|
_ = __addon__.getLocalizedString
|
|
|
|
# http://forum.kodi.tv/showthread.php?tid=230766
|
|
def handle_wait(time_to_wait, title, text):
|
|
dialog = xbmcgui.DialogProgress()
|
|
ret = dialog.create(' ' + title)
|
|
secs = 0
|
|
percent = 0
|
|
increment = int(100 / time_to_wait)
|
|
|
|
while secs < time_to_wait:
|
|
secs += 1
|
|
percent = increment*secs
|
|
secs_left = time_to_wait - secs
|
|
remaining_display = (_(2030).encode('utf-8')) % secs_left
|
|
dialog.update(percent, text, "", remaining_display)
|
|
xbmc.sleep(1000)
|
|
|
|
dialog.close()
|
|
return False
|
|
|
|
# how long to lock the screen
|
|
lock_secs = 30
|
|
handle_wait(lock_secs, _(2010).encode('utf-8'), _(2020).encode('utf-8'))
|