Req Conditional keymapping
#1
Hey guys,

although the prefix is [Feature Request] this is more some sort of idea and would need a huge cut in the core code but imagine the following:

What do you think of a conditional keymap?
Meaning, that the keyboard.xml, remote.xml or whatever also can interact with certain bools and window states of XBMC.

Here we go with an example:

Currently there is a single feature for one key in a section of keyboard.xml, like
PHP Code:
<i>Info</i

To have a more flexible keymap, you can think several conditions, like the dbox remote.
Opening the Info and by pressing i again heading to the EPG. something like:
PHP Code:
<i>Info</i>
<
i condition="Window.IsActive(2003)">EPG</i

Any opinions on this?

mad-max
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#2
Well there already are conditions in the keymap based on the window you are in. You specify
PHP Code:
<FullscreenVideo>
  <
left>SkipBackward</left>
</
FullscreenVideo>< 
so that's only valid in the FullscreenVideo window. Either I misunderstand your example or it's the same (except that the approach would probably be a bit more general).
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Hey montellese,

I think you missunderstood my idea.

I know that there are different sections that can be used but as I said above, each section (e.g. <FullscreenVideo>) has only one function for a key.
What I meant was multiple functions for one key within one section Big Grin

Sound weird...

Let me try it with another example:
PHP Code:
<FullscreenVideo>
  <
keyboard>
    <
i>ActivateWindow(foo)<i>
    <
i condition="Window.IsVisible(foo)">ActivateWindow(bar)</i>
    <
i condition="Window.IsVisible(bar)">CloseDialog</i>
  </
keyboard>
</
FullScreenVideo

So let's say, your watching a video and pressing "i", the videoinfo pops up. With visible videoinfo, you press "i" again and due to
PHP Code:
<i condition="Window.IsVisible(foo)">ActivateWindow(bar)</i
XBMC jumps from Window(foo) to Window(bar)...
And if you press "i" the third time the dialog closes.

Better explained?

EDIT:
Maybe the examples with different windows is a bit unlucky...
What about
PHP Code:
<Home>
  <
keyboard>
    <
i condition="!System.HasMedia">EjectTray()</i>
    <
i condition="System.HasMedia">PlayDVD()</i>
  </
keyboard>
</
Home

?
mad-max
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#4
IMO the best change we could do here is define contexts for keymaps (i.e. define the conditions needed) and use them instead of the silly window conditions where everything has to be repeated a bunch of times.

e.g. Play really only has different behaviour if something is already playing or paused or if you're focused on a list.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
Wouldn't this lead to problems as there were so many keys to define that the conditions would also be duplicates?
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#6
The problem now is that the conditions are too rigid - they're defined on windows only.

Define proper contexts that actually make sense and the number of contexts required drops away.

Simple contexts:
1. Global
2. In list
3. Playing song/video/slideshow
4. In fullscreen

For most users, that's probably enough.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
While adding the metadata actors script to my skin, I would like to open the actor info while pressing "i" in the actors list. Another section would be advanced launcher where it could be really helpful if users could open the game info dialog with "i". I don't know how this could be realized but conditional key mapping could be a way. It would be even better if a skinner could define an action for e.g. "i" with conditions so it's default for everyone... a skin keymap so to say. To avoid a completely different keymapping across skins, it should only be possible to map a default key if they are not used, e.g. "i" for actors.
Image
Reply
#8
I know I'm digging up an old topic but I would love to see conditional keymaps. Especially if I could map my keys different ways based on what skin I am in as certain skins add extra views and dialogs which are mapped to a key that is shared with another feature liek audio offset in my case but that only happens when I have something playing.
Reply
#9
I'd love to see someone take the time to code it up. Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
So is this subject dead? I still think it is a great idea. I'm trying to make a modification to appease the wife. Our old Netgear media box would pop up a message anytime you would press OK and add a song to the queue (add to queue was the default for Netgear). She wants that visual feedback again.

My idea was to use a notification action in the keymap.xml but would need the following qualifications or conditions.

<enter>Notification(Added to Queue,,200)</enter>
Only on the music navigation window (MyMusicNav.xml)
Only if the listitem is a song title (is ListItem.title?)
The ok button is pressed (keymap option for music window)
optionally only when "Queue Song on Selection" is enabled.

Or does anyone else have a suggestion on how to accomplish this?

Thanks,
Rob
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional keymapping0