Difference between revisions of "Features/Touch/Development"

From Sugar Labs
Jump to navigation Jump to search
(regrouped todo essential section)
 
(72 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Todo (essential)==
+
This page is about the development of the touch feature for the Sugar interface. Each item has a detailed implementation plan. The design decisions are based on these related pages:
  
===On screen keybord (OSK)===
+
: [[Design_Team/Sugar_Shell_Touch_Input|Sugar Shell Touch Input]]
 +
 
 +
: [[Talk:Design_Team/Sugar_Shell_Touch_Input|Sugar Shell Touch Input Talk]]
 +
 
 +
: [[Design_Team/Proposals/Touchscreen/On-screen_Keyboard|On Screen Keyboard]]
 +
 
 +
: [[Design_Team/Activity_Touch_Input|Activity Touch Input]]
 +
 
 +
 
 +
=Todo (essential)=
 +
 
 +
==On screen keybord (OSK)==
 
==== Canvas auto panning based on input focus====
 
==== Canvas auto panning based on input focus====
 +
* [http://gitorious.org/maliit/maliit-framework/commit/fbf52a206f14ce57b6ec9eba309d8dd67592d882/diffs maliit-framework: Emit GtkIMContext::clear-area on VKB relocations]
 +
* [http://git.gnome.org/browse/gtk+/log/?h=wip/im-osk-position GTK+ branch from Carlos]
 +
* [http://dev.laptop.org/~erikos/touch/0001-Window-Handle-request-unset-clear-area-to-keep-focus.patch patch for the sugar-toolkit-gtk3] to listen in the 'request-clear-area' and 'unset-clear-area' signal
 +
 
==== Show Frame or OSK, never both====
 
==== Show Frame or OSK, never both====
 +
When the OSK is up and the frame is revealed the OSK should go away, same when the Frame is up and the OSK is revealed (manually or automatically) the Frame should hide.
 +
* [http://gitorious.org/maliit/maliit-framework/blobs/master/maliit-glib/maliitinputmethod.h#line74 Maliit-glib API "maliit_input_method_hide"].
 +
 
==== Hide OSK key on OSK====
 
==== Hide OSK key on OSK====
 +
There should be a key on the OSK to manually hide the keyboard. Currently you can already hide the Maliit keyboard by a vertical stroke but that is not as discoverable and does not work as reliable (as of today).
 +
 +
The [http://gitorious.org/maliit/maliit-plugins/blobs/master/maliit-keyboard/data/styles/olpc-xo/main.ini#line29 functionality is already there] to add it to the style. We just have to add the key in the layout [http://gitorious.org/maliit/maliit-plugins/blobs/master/maliit-keyboard/data/languages/de.xml (per language)].
 +
 
==== Show OSK button on device Frame edge====
 
==== Show OSK button on device Frame edge====
 +
There should be a key on the Frame in the device section to manually reveal the OSK.
 +
* [http://gitorious.org/maliit/maliit-framework/blobs/master/maliit-glib/maliitinputmethod.h#line71 Maliit-glib API "maliit_input_method_show"], <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0009-Add-a-toolbutton-in-the-device-section-to-reveal-the.patch patch that adds a device button, clicking on it shows the OSK (works only when we ported the shell to dynamic bindings]
 +
 
==== Sugar theme====
 
==== Sugar theme====
 +
The OSK should have a Sugar theme and good quality font.
 +
 
==== Internationalisation====
 
==== Internationalisation====
 
* e.g. layout covers our accent needs
 
* e.g. layout covers our accent needs
 +
 
==== Multilingual====
 
==== Multilingual====
* e.g. ability to switching between at least two languages
+
* there should be the ability to switch between at least two languages, at the moment this can be done by swiping horizontally, this is not as discoverable and hard to do, would be nice to have a button for that (see iOS)
 +
* add languages, could be done in a control panel section
 +
 
 
==== Landscape/portrait====
 
==== Landscape/portrait====
 +
Currently not working anymore, [https://bugs.maliit.org/show_bug.cgi?id=183 upstream Maliit bug].
 +
 
==== Reveal on text input focus, auto **dismiss** on loss of focus====
 
==== Reveal on text input focus, auto **dismiss** on loss of focus====
 +
* Reveal the OSK when clicking e.g. on a GTK entry (working quite well already)
 +
* Dismiss the OSK when defocus: e.g. in Browse the OSK comes up when clicking in the url entry, clicking on the canvas defocus the entry and hide the OSK (is already working fine), in other places e.g. in the Neighborhood View when the search field is focused we have to see how we can do better, we can experiment with a) not putting the default focus in the search widget; b) on physical keyboard typing auto focus into the search widget. For b) we would need to check there is not some other text input widget in focus, e.g. in Journal view you might be trying to retitle an entry and would not want the search to grab input at that time, <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0007-Unfocus-the-search-entry-in-the-Home-and-Neighborhoo.patch patch to defocus when clicking on the canvas] and [http://dev.laptop.org/~erikos/touch/0008-Set-the-GTK_IM_MODULE-env-variable-to-Maliit.patch patch to set the env variable for Maliit]
 +
 
====Don't auto reveal in laptop mode, only ebook mode====
 
====Don't auto reveal in laptop mode, only ebook mode====
 +
For devices which have a hardware keyboard and a touchscreen the OSK should not be auto revealed in the "laptop mode". You will be able to manually reveal it with the button in the Frame.
  
=== Text selection ===
+
== Text selection ==
 
* Selection handles
 
* Selection handles
 
* Cut(?)/Copy/Paste/Speak selection palette
 
* Cut(?)/Copy/Paste/Speak selection palette
 +
* [http://wiki.sugarlabs.org/go/Design_Team/Sugar_Shell_Touch_Input#Text_editing design discussions]
 +
* [http://git.gnome.org/browse/gtk+/log/?h=touch-text-selection GTK+ branch from Carlos]
 +
 +
== Drag scrolling support==
 +
For example scrolling in the Journal or the activity list view.
 +
 +
== Hide/show mouse cursor based on input method==
 +
When in Ebook mode, or when using the touch screen, the cursor should be hidden. When using the trackpad the cursor should be revealed. Idealy fade the cursor in and out of visibility using alpha if possible.
 +
 +
== Palette behaviours ==
 +
* Tapping/clicking icons with no primary action should instantly open full palette
 +
** Frame: buddy icons
 +
** central home buddy icon, <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0001-Make-the-palette-come-up-on-left-click-for-the-buddy.patch patch]
 +
** Frame: network device icons and the battery icon, <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0006-Frame-Device-left-click-on-network-icons-or-battery-.patch patch]
 +
* Tapping/clicking toolbar icons with no primary action that are open should close the palette
 +
** e.g. Journal: sort icon
 +
* Home View activity icons: leave behavior as is or always show palette, ideally we have the intermediate screen
 +
* Journal: auto-resume is the primary action when clicking on an activity entry, current behavior is correct here
  
=== Drag scrolling support===
+
== Frame ==
 +
* Expose/hide gesture: reveal/hide the Frame by a swipe in/out gesture, revealing would be a gesture over the frame area into the center and the other way around to hide, will collide when you sketch at the edge of the Paint activity if the gesture is not carefully tuned (a swipe, not slow drag, of short length perpendicular to frame edge, diagonal at corners).
 +
* Button for top left (fallback)
 +
* Use the square game button on the XO as a Frame button, <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0003-Use-the-square-game-button-on-the-XO-as-a-Frame-butt.patch patch]
 +
* do not hide frame on mouse out, do hide frame when going to a hot corner (and frame is visible), <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0005-New-frame-interaction.patch patch]
 +
* hide frame when an activity is selected (todo: hide as well when resume in the palette is clicked), <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0005-New-frame-interaction.patch patch] (the problem is when you want to get to the secondary options - use touch & hold ?, the resume option should be more visible as primary option - hint at separator)
 +
* hide frame when a zoom level is selected, <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0005-New-frame-interaction.patch patch]
  
=== Hide/show mouse cursor based on input method===
+
==Switch between Views==
 +
* use Frame (see Frame section)
 +
* discuss: use Gesture (pinch/zoom, or horizontal swipe)
  
=== Palette behaviours ===
+
==Switch between activities==
* Tapping icons with no primary action should instantly open full palette
+
* use Frame (see Frame section)
** e.g. right frame edge buddy icons; central home buddy icon; access Point device icon
+
* discuss: use Gesture (horizontal swipe)
  
=== Frame ===
+
==Gestures==
* Expose/hide gesture!!!
+
* we want the following gestures to be supported in Activities: touch-and-hold, swipes (left/right/up/down), and pinch-to-zoom
** Button for top left (fallback)
+
* we need global gestures as well (e.g. Frame)
 +
* http://git.gnome.org/browse/gtk+/commit/?h=gestures
  
=== Home view===
+
== Home view==
 
* Disable Activity icon dragging in fixed layouts
 
* Disable Activity icon dragging in fixed layouts
 
** e.g. allows easier access to long hold of Activity icon to access palette
 
** e.g. allows easier access to long hold of Activity icon to access palette
  
=== Neighbourhood view===
+
== Neighbourhood view==
* Remove primary action from AP icons
+
* Remove primary action from AP icons (raise palette), <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0002-Make-the-AP-icon-the-Ad-hoc-and-the-Mesh-network-ico.patch patch]
* Remove primary action from ad-hoc icons
+
* Remove primary action from ad-hoc/mesh icons (raise palette), <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0002-Make-the-AP-icon-the-Ad-hoc-and-the-Mesh-network-ico.patch patch]
* Remove primary action from shared activity icons
+
* Remove primary action from shared activity icons (raise palette), <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0004-Neighbourhood-view-remove-primary-action-from-shared.patch patch]
 +
* Remove primary action from buddy icons (raise palette), <span style="color:#f99506;">testing</span> [http://dev.laptop.org/~erikos/touch/0001-Make-the-palette-come-up-on-left-click-for-the-buddy.patch patch]
  
=== Journal ===
+
== Journal ==
 
* Touch & hold on an entry should invoke full palette
 
* Touch & hold on an entry should invoke full palette
 
* Dragging an entry needs to work but not prevent the touch and hold palette (if finger moves a little)
 
* Dragging an entry needs to work but not prevent the touch and hold palette (if finger moves a little)
 
** e.g. to copy it to another volume
 
** e.g. to copy it to another volume
 +
** see how it is handled in the home screen in iOS for touch & hold and the swipe gesture
 +
* add copy option for the DOCUMENTS folder in the entry Palette and Details View Copy toolbar button
 +
* Detail/List View: Erase (and Duplicate) tools should both raise confirmation alerts
  
===Combobox===
+
==Combobox==
* Single touch of a combo should lock open it's palette and allow drag scrolling
+
* Single touch of a combo should lock open it's palette and allow drag scrolling, <span style="color:#2ce713;"> Fix from: Carlos Garnacho </span>[http://git.gnome.org/browse/gtk+/commit/?id=bd3ca2b30efc534f8b7c18dfd8a9f072592044c7 landed in GTK+ 3.5.10]
* Should not show blank space when previous selection was near the bottom of the list
+
* Should not show blank space when previous selection was near the bottom of the list (not as bad when the scrolling works, [https://bugzilla.gnome.org/show_bug.cgi?id=678113 discussion why technically this is really hard to do])
* Up/down menu/combo overflow widgets need to be larger
+
* Up/down menu/combo overflow widgets need to be larger (could probably be done in the theme)
 +
* [http://dev.laptop.org/~erikos/touch/activity.py activity.py] for HelloWorld activity that has a ComboBox to test with
  
=== Touch & hold '==' right click equivalent===
+
== Touch & hold '==' right click equivalent==
 +
The right click is the equivalent to touch and hold, e.g. bringing up the Palette immediately.
  
=== Visual feedback for button presses===
+
== Visual feedback for button presses==
 
* Generic solution - use a mouse HW cursor with alpha white 'glow' marking all primary touch events?  
 
* Generic solution - use a mouse HW cursor with alpha white 'glow' marking all primary touch events?  
 
* Existing GTK button down highlights work well in toolbars
 
* Existing GTK button down highlights work well in toolbars
Line 63: Line 132:
 
** Only really needed where there is no palette and/or primary action is too slow
 
** Only really needed where there is no palette and/or primary action is too slow
  
=== Visual feedback for touch and hold ===
+
== Visual feedback for touch and hold ==
* Animated circle timer?
+
* Animated circle timer? Carlos did some work on that in GTK+, see in [http://people.gnome.org/~carlosg/oggs/multitouch.ogg this video], at ~30 seconds.
 
* Blinking grey round rect outline
 
* Blinking grey round rect outline
  
* Activities
+
= Todo (ideal) =
** Write
 
** Browse
 
** Paint
 
** Read
 
** Calculate
 
** Turtle Art
 
 
 
== Todo (Ideal) ==
 
  
 
* Palette behaviours
 
* Palette behaviours
Line 99: Line 160:
 
* Priorities UI redraw over other processes
 
* Priorities UI redraw over other processes
 
** e.g. don't stall the UI thread
 
** e.g. don't stall the UI thread
* Activities
 
** Physics
 
** Clock
 
** Memorize
 
** Image Viewer
 
** Abacus
 
** FotoToon
 
** Implode
 
** Labyrinth
 
** Chat
 
** Help
 
*** e.g. pick up web kit features
 
** WikipediaEN/ES
 
*** e.g. pick up web kit features
 
** Maze
 
  
== Todo (polish) ==
+
 
 +
= Todo (polish) =
  
 
* Smooth transitions/animations
 
* Smooth transitions/animations
Line 137: Line 184:
 
** Remove start/resume palette
 
** Remove start/resume palette
 
** Palette options presented in fullscreen UI, before activity pulse loader
 
** Palette options presented in fullscreen UI, before activity pulse loader
* Activities
 
** Record
 
** Distance
 
** Get Books
 
** InfoSlicer
 
** Jukebox
 
** Log
 
** Measure
 
** Moon
 
** Portfolio
 
** Pippy
 
** Ruler
 
** Speak
 
** StopWatch
 
** Terminal
 
** Typing Turtle
 
** Words
 
 
==== Not in this cycle ====
 
 
* Activities
 
** TamTamEdit
 
** TamTamJam
 
** TamTamMini
 
** TamTamSynthLab
 
** Etoys
 
** Scratch
 
 
==== Related pages ====
 
  
: [[Design_Team/Sugar_Shell_Touch_Input|Sugar Shell Touch Input]]
 
  
: [[Talk:Design_Team/Sugar_Shell_Touch_Input|Sugar Shell Touch Input Talk]]
+
=Done=
  
: [[Design_Team/Proposals/Touchscreen/On-screen_Keyboard|On Screen Keyboard]]
+
=Test=
 +
==Apply patches to Sugar==
 +
* yum install gettext GConf2-devel gtk2-devel intltool perl-XML-Parser pkgconfig python pygtk2-devel make gcc
 +
* git clone git://git.sugarlabs.org/sugar/mainline.git shell
 +
* cd shell
 +
* git checkout 6fbc4188249a6f59cc55381824cf1ec1f90dc5e8 (master has changed already since the patches have been made)
 +
* ./autogen.sh --prefix=/usr
 +
* wget http://dev.laptop.org/~erikos/touch/0001-Make-the-palette-come-up-on-left-click-for-the-buddy.patch
 +
* git am 0001-Make-the-palette-come-up-on-left-click-for-the-buddy.patch
 +
* make
 +
* sudo make install
  
: [[Design_Team/Activity_Touch_Input|Activity Touch Input]]
+
==Patches==
 +
The patches are in [http://dev.laptop.org/~erikos/touch/ my public home folder]. They are as well linked for the individual item they fix above. Most of them should be independent from each other, to be sure to not run into any dep issues you need to apply them in order.
  
==Done==
+
==Restart Sugar==
 +
If you want to be able to restart Sugar with the ctrl+alt+bksp command on the XO you can set the Option "DontZap" to "false" in the "ServerFlags" section in the xorg config file (/etc/X11/xorg.conf.d/xo1.75.conf).

Latest revision as of 06:02, 22 August 2012

This page is about the development of the touch feature for the Sugar interface. Each item has a detailed implementation plan. The design decisions are based on these related pages:

Sugar Shell Touch Input
Sugar Shell Touch Input Talk
On Screen Keyboard
Activity Touch Input


Todo (essential)

On screen keybord (OSK)

Canvas auto panning based on input focus

Show Frame or OSK, never both

When the OSK is up and the frame is revealed the OSK should go away, same when the Frame is up and the OSK is revealed (manually or automatically) the Frame should hide.

Hide OSK key on OSK

There should be a key on the OSK to manually hide the keyboard. Currently you can already hide the Maliit keyboard by a vertical stroke but that is not as discoverable and does not work as reliable (as of today).

The functionality is already there to add it to the style. We just have to add the key in the layout (per language).

Show OSK button on device Frame edge

There should be a key on the Frame in the device section to manually reveal the OSK.

Sugar theme

The OSK should have a Sugar theme and good quality font.

Internationalisation

  • e.g. layout covers our accent needs

Multilingual

  • there should be the ability to switch between at least two languages, at the moment this can be done by swiping horizontally, this is not as discoverable and hard to do, would be nice to have a button for that (see iOS)
  • add languages, could be done in a control panel section

Landscape/portrait

Currently not working anymore, upstream Maliit bug.

Reveal on text input focus, auto **dismiss** on loss of focus

  • Reveal the OSK when clicking e.g. on a GTK entry (working quite well already)
  • Dismiss the OSK when defocus: e.g. in Browse the OSK comes up when clicking in the url entry, clicking on the canvas defocus the entry and hide the OSK (is already working fine), in other places e.g. in the Neighborhood View when the search field is focused we have to see how we can do better, we can experiment with a) not putting the default focus in the search widget; b) on physical keyboard typing auto focus into the search widget. For b) we would need to check there is not some other text input widget in focus, e.g. in Journal view you might be trying to retitle an entry and would not want the search to grab input at that time, testing patch to defocus when clicking on the canvas and patch to set the env variable for Maliit

Don't auto reveal in laptop mode, only ebook mode

For devices which have a hardware keyboard and a touchscreen the OSK should not be auto revealed in the "laptop mode". You will be able to manually reveal it with the button in the Frame.

Text selection

Drag scrolling support

For example scrolling in the Journal or the activity list view.

Hide/show mouse cursor based on input method

When in Ebook mode, or when using the touch screen, the cursor should be hidden. When using the trackpad the cursor should be revealed. Idealy fade the cursor in and out of visibility using alpha if possible.

Palette behaviours

  • Tapping/clicking icons with no primary action should instantly open full palette
    • Frame: buddy icons
    • central home buddy icon, testing patch
    • Frame: network device icons and the battery icon, testing patch
  • Tapping/clicking toolbar icons with no primary action that are open should close the palette
    • e.g. Journal: sort icon
  • Home View activity icons: leave behavior as is or always show palette, ideally we have the intermediate screen
  • Journal: auto-resume is the primary action when clicking on an activity entry, current behavior is correct here

Frame

  • Expose/hide gesture: reveal/hide the Frame by a swipe in/out gesture, revealing would be a gesture over the frame area into the center and the other way around to hide, will collide when you sketch at the edge of the Paint activity if the gesture is not carefully tuned (a swipe, not slow drag, of short length perpendicular to frame edge, diagonal at corners).
  • Button for top left (fallback)
  • Use the square game button on the XO as a Frame button, testing patch
  • do not hide frame on mouse out, do hide frame when going to a hot corner (and frame is visible), testing patch
  • hide frame when an activity is selected (todo: hide as well when resume in the palette is clicked), testing patch (the problem is when you want to get to the secondary options - use touch & hold ?, the resume option should be more visible as primary option - hint at separator)
  • hide frame when a zoom level is selected, testing patch

Switch between Views

  • use Frame (see Frame section)
  • discuss: use Gesture (pinch/zoom, or horizontal swipe)

Switch between activities

  • use Frame (see Frame section)
  • discuss: use Gesture (horizontal swipe)

Gestures

Home view

  • Disable Activity icon dragging in fixed layouts
    • e.g. allows easier access to long hold of Activity icon to access palette

Neighbourhood view

  • Remove primary action from AP icons (raise palette), testing patch
  • Remove primary action from ad-hoc/mesh icons (raise palette), testing patch
  • Remove primary action from shared activity icons (raise palette), testing patch
  • Remove primary action from buddy icons (raise palette), testing patch

Journal

  • Touch & hold on an entry should invoke full palette
  • Dragging an entry needs to work but not prevent the touch and hold palette (if finger moves a little)
    • e.g. to copy it to another volume
    • see how it is handled in the home screen in iOS for touch & hold and the swipe gesture
  • add copy option for the DOCUMENTS folder in the entry Palette and Details View Copy toolbar button
  • Detail/List View: Erase (and Duplicate) tools should both raise confirmation alerts

Combobox

  • Single touch of a combo should lock open it's palette and allow drag scrolling, Fix from: Carlos Garnacho landed in GTK+ 3.5.10
  • Should not show blank space when previous selection was near the bottom of the list (not as bad when the scrolling works, discussion why technically this is really hard to do)
  • Up/down menu/combo overflow widgets need to be larger (could probably be done in the theme)
  • activity.py for HelloWorld activity that has a ComboBox to test with

Touch & hold '==' right click equivalent

The right click is the equivalent to touch and hold, e.g. bringing up the Palette immediately.

Visual feedback for button presses

  • Generic solution - use a mouse HW cursor with alpha white 'glow' marking all primary touch events?
  • Existing GTK button down highlights work well in toolbars
  • Shell canvas area views
    • Use grey round rect outline for presses
      • AP icons
      • Activity icons
      • Buddy icons
      • Ad-hoc icons
    • Only really needed where there is no palette and/or primary action is too slow

Visual feedback for touch and hold

  • Animated circle timer? Carlos did some work on that in GTK+, see in this video, at ~30 seconds.
  • Blinking grey round rect outline

Todo (ideal)

  • Palette behaviours
    • Single touch should never trigger hover content
    • Touch and hold should raise hover content
    • Touching the icon of an open palette should close the palette
      • e.g. Journal list sort palette
  • Toolbar overflow widget should be same size as Sugar toolbar button icons
  • Zoom to content behaviour
    • e.g. Browse
  • Frame
    • Activity Zoom icon (and physical key) should act like Alt-Tab
  • Home view
    • Improve layouts
      • e.g. larger Activity icon usage where possible
      • e.g. Increase separation between icons where possible
  • Details view
    • Alert dialogue needed for Erase toolbar button
    • Alert dialogue needed for Duplicate toolbar button
  • Accelerometer auto rotate based on rotation when laptop is in ebook mode
  • Drag scrolling
    • Smooth!!
  • Priorities UI redraw over other processes
    • e.g. don't stall the UI thread


Todo (polish)

  • Smooth transitions/animations
  • Text selection
    • Feature extensible selection palette
      • e.g. Activity specific formatting
  • Home view
    • New grid layout option
  • Make sure Activities and shell works well in portrait
    • e.g. toolbar button overflow in some Activities
  • Pre-light hover effects (remove for touch screen input)
  • hspan/vspan separators, make sure they are large enough for finger interaction
  • OSK
    • Subtle key click feedback
    • Custom context
    • Custom key strips/extras based on Activity
    • Predictive text
      • Context sensitive
      • Locale sensitive
  • Activity start/resume screen
    • Remove start/resume palette
    • Palette options presented in fullscreen UI, before activity pulse loader


Done

Test

Apply patches to Sugar

Patches

The patches are in my public home folder. They are as well linked for the individual item they fix above. Most of them should be independent from each other, to be sure to not run into any dep issues you need to apply them in order.

Restart Sugar

If you want to be able to restart Sugar with the ctrl+alt+bksp command on the XO you can set the Option "DontZap" to "false" in the "ServerFlags" section in the xorg config file (/etc/X11/xorg.conf.d/xo1.75.conf).