[iPhone] swipe navigation

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #1
I noticed on the latest nightlies that swipe up and swipe down have been added that do up or down in general navigation. As anyone with an iPhone or iPod touch knows, using XBMC on such a small screen is a pain, but using swipe navigation actually makes it no harder to use than using the ATV remote control. So I changed my keymap file so that swipe left and swipe right (which are backspace and tab respectively) are now left and right.

So we've got up, down, left, right, and back (double tap). All I need now is select.

Since just touching the screen is seen as using the cursor I tried editing the mouse.xml file to making left-mouse "select" but this didn't work. I tried to see if there were any other undocumented gestures that I could use, but I haven't seen any past up/down.

Any ideas?
find quote
keith Offline
Team-XBMC Member
Posts: 690
Joined: Sep 2007
Reputation: 3
Location: SF, CA
Post: #2
Ned Scott Wrote:I noticed on the latest nightlies that swipe up and swipe down have been added that do up or down in general navigation. As anyone with an iPhone or iPod touch knows, using XBMC on such a small screen is a pain, but using swipe navigation actually makes it no harder to use than using the ATV remote control. So I changed my keymap file so that swipe left and swipe right (which are backspace and tab respectively) are now left and right.

So we've got up, down, left, right, and back (double tap). All I need now is select.

Since just touching the screen is seen as using the cursor I tried editing the mouse.xml file to making left-mouse "select" but this didn't work. I tried to see if there were any other undocumented gestures that I could use, but I haven't seen any past up/down.

Any ideas?

Try disabling the mouse entirely?

FOR IOS: xbmc.log: /var/mobile/Library/Preferences/xbmc.log (be sure to enable debugging)
For troubleshooting and bug reporting please make sure you read this first.
Always read the XBMC online-manual, FAQ and search the forum before posting.
MediaInfo : http://mediainfo.sourceforge.net/
find quote
matrix Offline
Junior Member
Posts: 7
Joined: Jan 2009
Reputation: 0
Post: #3
When I tried disabling the mouse on the ios build on an ipad, I was left unable to control xbmc and had to ssh in to re-enable navigation
find quote
pecinko Offline
Donor
Posts: 3,677
Joined: Dec 2008
Reputation: 49
Location: Prague / Belgrade
Post: #4
Slighty OT, but since swipe works, should we expect that press and hold on remote direction buttons would scroll list in near future, reducing the use of scrollbars?

My skins:

Amber
Quartz

find quote
stickman Offline
Junior Member
Posts: 34
Joined: Mar 2004
Reputation: 0
Post: #5
Ned Scott Wrote:I noticed on the latest nightlies that swipe up and swipe down have been added that do up or down in general navigation. As anyone with an iPhone or iPod touch knows, using XBMC on such a small screen is a pain, but using swipe navigation actually makes it no harder to use than using the ATV remote control. So I changed my keymap file so that swipe left and swipe right (which are backspace and tab respectively) are now left and right.

So we've got up, down, left, right, and back (double tap). All I need now is select.

Since just touching the screen is seen as using the cursor I tried editing the mouse.xml file to making left-mouse "select" but this didn't work. I tried to see if there were any other undocumented gestures that I could use, but I haven't seen any past up/down.

Any ideas?

Would you mind sharing the relevant changes you made to the keymap files so we can get those 5 gestures?

Thx!
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #6
My keyboard.xml file: http://db.tt/jtRQXQn

Also, looks like double tap is sometimes back and sometimes contextual menu. So in a perfect world, if we could get two new programable gestures, we'd be all set!
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #7
I hate to bump a thread for simply the sake of bumping it, and I normally get mad at other people for doing this, but consider this me on my knees and begging for two more configurable touch gestures
find quote
dazex Offline
Donor
Posts: 539
Joined: Nov 2009
Reputation: 0
Post: #8
I just want to say, until the developer can get around figuring out how to expose more touch controls....

....the controls we DO have access to now can go a lot further than you'd think. I am going to attempt to get everyone reading this thread on the same page. Please forgive me if I am being too obvious. This is currently how XBMC on touch devices like iPhone and iPad works:

We currently have five "hacks" for touch enabled controls to use with iPhone and iPad.

up, down, left, right, tap and double-tap.

The file keyboard.xml controls the following swipe actions:
up, down, left, right

The file mouse.xml controls the following touch actions:
tap and double-tap

----------------

Each of those controls can be configured to do something different, depending on which XBMC window is active.

For the swipe actions, you can control the result of it by editing the pertinent section of your keyboard.xml file.

Here is the key piece of info:
By default, some of those actions are "wasted" the way they are mapped. (No fault of the developer if you understand the unlaying problems/reasons.)

To elaborate, at the XBMC home screen:

-Swipe left is wasted because it issues the "backspace" command. However, you are already at the top level, so it essentially does nothing.

-Similarly, Swipe right issues the "tab" command, which toggles between "fullscreen" mode (Gets you out of and back to your currently playing video). If you do not have a video running, this Swipe action is useless. IMHO, is probably not used much by iPhone and iPad users

-Doubletapping is also wasted as it issues the mouse command of "rightclick"

Now, to create some customization to tailor XBMC to behave more to your liking, simply edit the <home> section of the keyboard.xml file. The <home> section defines what commands each of the swipe action sends to XBMC to execute while at the homescreen.

For example:
Swipe left can be remapped to "Left"
Swipe right can be remapped to "Right"
Swipe up and down can stay with it's default mapping of "Up" and "Down".
DoubleTapping can be remapped to bring up the "Favorites" window.

Making those changes above makes navigating the XBMC GUI on the iPhone and iPad much useable at the homescreen. Of course, feel free to have those actions mapped to something else if you'd like. Since you are only editing(or adding in the case of mouse.xml) the <home> section, those actions will only go into affect when you are at the home screen of XBMC.

---------
Taking this concept further, you can edit the <MyVideoFiles> to affect the actions when XBMC is in the video file mode.
Some more example sections that I like to customize myself are:

<FullscreenVideo> affects the touch controls while a video is playing in fullscreen.
My customizations...
Swipe left: skip forward 30 seconds
Swipe right: skip backwards 30 seconds
Swipe up: brings up the <FullScreenInfo> overlay
Swipe down: brings up the <VideoOSD> overlay
Single Tap: Pause/Play
Double Tap: Brings up menu (VideoOSD)

<FullScreenInfo> affects the touch controls when the movie artwork and seekbar is shown.
My customizations...
Swipe left: skip backwards 10 mins
Swipe right: skip forward 10 mins
Swipe up: close/exit the information overlay
Swipe down:

<VideoOSD> affects the touch controls when the menu is shown while the video is playing.
My customizations...
Swipe left: moves cursor left
Swipe right: moves cursor right
Swipe up:
Swipe down: close/exit the menu
Double Tap: Stop and Exit video

I could go on and on, but I hope you understand how to make those few touch events equal to more than just the default 4 actions, based on what window is onscreen.

Also, to clear up your confusion about double-tapping being inconsistent.
Ned Scott Wrote:Also, looks like double tap is sometimes back and sometimes contextual menu.
In the video list view (I am assuming this is the view you were talking about):
Double-tap on a element that has a context menu will pop up the context menu. i.e. double-tap a video title will pop up the context menu.

Double-tapping on any other area by default takes you back to the home screen.

----------------

Anyways, I feel like I am beating a dead horse at this poing. Hopefully that points you into the right direction. Understanding these concept fully, you can make the current "hacky" implementation of touch control, much more useable that you think. Combine that with a custom skin that mimic's Apple's GUI guidelines, the "need" for additional touch events becomes less and less necessary.

Let me know if I managed to lose you. I don't want to throw too much out at once. I can give more examples if you'd like. However, let us know if this spark any ideas for you to customize your XBMC to your specific need.

Good luck customizing to your heart's content! The XBMC project really is amazing.

cheers,
-Dazex
(This post was last modified: 2011-06-28 03:47 by dazex.)
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #9
You seem to have read my post, yet not at all. That is exactly what I did and mouse.xml did nothing for taps.
find quote
dazex Offline
Donor
Posts: 539
Joined: Nov 2009
Reputation: 0
Post: #10
I did read your post and forgive me if in the mist of trying to help, I did not answer one of your comment directly. Or did you ask a question that I missed to answer?

Editing mouse.xml to have leftclick map to "Select" does work for me. If you enable debugging and look at your debug log, you can see/verify if the leftclick action is properly detected and the resulting action.

Here is a snippet from my log on what to look for.

Code:
17:41:10 T:805208064 M:293474304   ERROR: Control 1 in window 10099 has been asked to focus, but it can't
17:41:10 T:805208064 M:293474304   DEBUG: ProcessMouse: trying mouse action Select

Editing leftclick alone causes the hacky implementation of touch support to behave wierd. I found that <leftclick> mapped to "mousemove" and <mousemove> mapped to select behaves more the way I want.

Code:
<keymap>
  <global>
    <mouse>
      <leftclick>mousemove</leftclick>
      <middleclick>middleclick</middleclick>
      <rightclick>rightclick</rightclick>
      <doubleclick>doubleclick</doubleclick>
      <wheeldown>wheeldown</wheeldown>
      <wheelup>wheelup</wheelup>
      <mousedrag>mousedrag</mousedrag>
      <mousemove>Select</mousemove>
    </mouse>
  </global>
  <Home>
    <mouse>
      <rightclick>ActivateWindow(Favourites)</rightclick>
    </mouse>
  </Home>
  <FullscreenVideo>
    <mouse>
     <leftclick>Pause</leftclick>
     <rightclick>ActivateWindow(VideoOSD)</rightclick>
    </mouse>
  </FullscreenVideo>
  <FullscreenInfo><!-- Information Overlay -->
    <mouse>
     <leftclick>Pause</leftclick>
     <rightclick>ShowVideoMenu</rightclick>
    </mouse>
  </FullscreenInfo>
  <VideoOSD><!-- Menu -->
    <mouse>
     <leftclick>Pause</leftclick>
     <rightclick>Stop</rightclick>
    </mouse>
  </VideoOSD>
</keymap>
(This post was last modified: 2011-06-28 03:53 by dazex.)
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #11
That last post helps greatly. I did not need an explanation on how to modify keyboard.xml or the finer points of touch-UI. The previous post just repeated what we had already knew. I had previously tried modifying mouse.xml without success. Your "mouse move" modification did the trick!

Thank you a million times! I am in your debt.
(This post was last modified: 2011-06-28 17:12 by Ned Scott.)
find quote
dazex Offline
Donor
Posts: 539
Joined: Nov 2009
Reputation: 0
Post: #12
Glad it helped.

And Ned, my original post wasn't just for you...but for all others that may come looking.

My intention was never to belittle what you knew. It was to get everyone on the same page so what I had to say actually made sense.

cheers,
-Dazex
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,365
Joined: Jan 2011
Reputation: 222
Location: Arizona, USA
Post: #13
dazex Wrote:Glad it helped.

And Ned, my original post wasn't just for you...but for all others that may come looking.

My intention was never to belittle what you knew. It was to get everyone on the same page so what I had to say actually made sense.

cheers,
-Dazex

My apologies. I guess I was on a bit of a one track mind and wasn't seeing past my own needs. Thank you again for your help, and I do hope this helps a lot of people until we get a more touch/small-screen friendly skin and/or more gesture support.
find quote