[REQUEST] Create a boolean condition for "Touchscreen Mode" in XBMC skinnning-engine?
#1
Lightbulb 
Hi,

I am trying to modify the PM3-HD skin files to integrate properly some touchscreen buttons.
I am faced to the problem that there is not a boolean conditions to know if "Touchscreen.Mode" is enabled or not. (at least, not listed here)
So I can not hide/unhide those specific buttons and the contents of the "pointer.xml" file (To avoid to see the VERY useless cursor when Touchscreen mode is selected)

As an example, I would like to create a radio button in "Appareances settings" :
Code:
<control type="radiobutton">
    <visible>ControlGroup(10019).HasFocus</visible>
    <description>Radio button for enabling/disabling touchscreen</description>
    <label>Touchscreen mode</label>
    <include>ButtonCommonValues</include>
    [b]<onclick>Touchscreen.Mode(1)</onclick>[/b]
</control>

But there is not any boolean test to use with the <onclick>
So my other button :
Code:
<control type="button">
    <description>Back button</description>
    <visible>!Touchscreen</visible>
    <include>ButtonCommonValues</include>
    <onclick>ActivateWindow(Settings)</onclick>
</control>
Is always on screen Sad

Maybe there is a way to use the onclick function to change the value of a variable that I would be able to create but in the wiki it is written that :
"Specifies the action to perform when the button is pressed. Should be a built in function."
Plus I did not find any information about creating a variable for a user...



If it is possible to do without implementing a new boolean test, any help would be appreciated


Thank you
Reply
#2
LoloMc² Wrote:Hi,

I am trying to modify the PM3-HD skin files to integrate properly some touchscreen buttons.
I am faced to the problem that there is not a boolean conditions to know if "Touchscreen.Mode" is enabled or not. (at least, not listed here)
So I can not hide/unhide those specific buttons and the contents of the "pointer.xml" file (To avoid to see the VERY useless cursor when Touchscreen mode is selected)

There's already an option to hide the pointer, so why not use that?
Settings>Appearance>Look & Feel>Enable Mouse

LoloMc² Wrote:As an example, I would like to create a radio button in "Appareances settings"

It's not possible to add something to the appearance settings, those entries defined by XBMC, not by the skin. Custom settings can be added to the Skin Settings section.
Just have a look at custom_SkinSetting_1111.xml, there's plenty of examples there on how to define custom options.

What you're trying to do, should be something like this, i guess:
Code:
<control type="radiobutton">
    <description>Radio button for enabling/disabling touchscreen</description>
    <label>Touchscreen mode</label>
    <include>ButtonCommonValues</include>
    [b]<onclick>Skin.ToggleSetting(Touchscreen-Mode)</onclick>[/b]
</control>

Code:
<control type="button">
    <description>Back button</description>
    [b]<visible>Skin.HasSetting(Touchscreen-Mode)</visible>[/b]
    <include>ButtonCommonValues</include>
    <onclick>ActivateWindow(Settings)</onclick>
</control>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
ronie Wrote:There's already an option to hide the pointer, so why not use that?
Settings>Appearance>Look & Feel>Enable Mouse

Hi Ronie and thank you for your answer.
This option disables the mouse control (the touchscreen either as you can imagine) and this is not what I want.
What I would like is to "hide" the cursor.
You can try it easily by shuting down XBMC, renaming the "pointer.xml" file (in the XBMC\skin\PM3.HD\720P\ folder), and restarting XBMC. You'll see that the mouse control is still there but you do not see the cusor.

ronie Wrote:It's not possible to add something to the appearance settings, those entries defined by XBMC, not by the skin.
I though it was only possible after compiling the whole code source (And I am not able Confused) but I was not sure. So I tried to use a radiobutton like on this screen copy
Image

ronie Wrote:Custom settings can be added to the Skin Settings section.
Just have a look at custom_SkinSetting_1111.xml, there's plenty of examples there on how to define custom options.
I'll have a look today, thank you

ronie Wrote:What you're trying to do, should be something like this, i guess:
Code:
<control type="radiobutton">
    <description>Radio button for enabling/disabling touchscreen</description>
    <label>Touchscreen mode</label>
    <include>ButtonCommonValues</include>
    [b]<onclick>Skin.ToggleSetting(Touchscreen-Mode)</onclick>[/b]
</control>

Code:
<control type="button">
    <description>Back button</description>
    [b]<visible>Skin.HasSetting(Touchscreen-Mode)</visible>[/b]
    <include>ButtonCommonValues</include>
    <onclick>ActivateWindow(Settings)</onclick>
</control>

This is nearly working but I would like that XBMC reminds the setting when restarting. :confused2:
Plus I need to work the opposite way, but that's just a matter of reading the documentation :o
EDIT : I found the opposite way
EDIT2 : Something goes wrong ! Each time I quit and relaunch XBMC, the setting is working a different way than the previous one ! (I mean one time it is negative and next launch is positive)

EDIT3 : Solved by using <selected>Skin.HasSetting(Touchscreen-Mode)</selected> in my radiobutton properties
Reply
#4
LoloMc² Wrote:Hi Ronie and thank you for your answer.
This option disables the mouse control (the touchscreen either as you can imagine) and this is not what I want.
What I would like is to "hide" the cursor.
You can try it easily by shuting down XBMC, renaming the "pointer.xml" file (in the XBMC\skin\PM3.HD\720P\ folder), and restarting XBMC. You'll see that the mouse control is still there but you do not see the cusor.

Ah, i see, i thought a touchscreen was controlled by a keyboard control rather than a mouse control, but i now see it's the other way around.
To hide the mouse, i guess you could use <visible> statements in Pointer.xml,
Something like this:
Code:
<control type="image" id="1">
    <description>Pointer Image</description>
    <posx>0</posx>
    <posy>0</posy>
    <width>32</width>
    <height>32</height>
    <texture>pointer-nofocus.png</texture>
    <visible>!Skin.HasSetting(Touchscreen-Mode)</visible>
</control>


LoloMc² Wrote:I though it was only possible after compiling the whole code source (And I am not able Confused) but I was not sure. So I tried to use a radiobutton like on this screen copy

Yes, adding it to the left menu is also possible.

LoloMc² Wrote:This is nearly working but I would like that XBMC reminds the setting when restarting. :confused2:
Plus I need to work the opposite way, but that's just a matter of reading the documentation :o
EDIT : I found the opposite way
EDIT2 : Something goes wrong ! Each time I quit and relaunch XBMC, the setting is working a different way than the previous one ! (I mean one time it is negative and next launch is positive)

EDIT3 : Solved by using <selected>Skin.HasSetting(Touchscreen-Mode)</selected> in my radiobutton properties

Glad you figured it out. ;-)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Thumbs Up 
Ronie

No more to say : thank you !
Everything is working the way I wanted Nod

I'll change the topic name for solved (If I find how to)
Reply
#6
hi is it possible for you to share youre working version with tochscreen functions

i have been looking for weeks for a working version

thx in advance
Reply
#7
did you check these threads?

http://forum.xbmc.org/showthread.php?tid=57940

http://forum.xbmc.org/showthread.php?tid=48818
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
[REQUEST] Create a boolean condition for "Touchscreen Mode" in XBMC skinnning-engine?0