HP Dx9000 Resources for Developing Touch-Friendly Applications for HP Business - Page 8

Flick Gestures

Page 8 highlights

The following code fragment of a Windows Presentation Foundation (WPF) application shows that the code to handle the users touching/tapping the exit button is just the very same code that handles a mouse click to the exit button. public Window1() { InitializeComponent(); //add the event handler to handle users click/tap the exit button button1.Click += new RoutedEventHandler(exitButton_Click); } private void exitButton_Click(object sender, RoutedEventArgs e) { //close the window to exit the application this.Close(); } You may wonder why there is nothing relating to touch in this code. The operating system synthesizes the tap or the touch on the exit button to the mouse left click message, so no extra code is needed to handle the tap/touch to the button other than the usual left mouse click event handler. When users use the mouse and leftclick on the button, exitButton_Click is detected. And the very same exitButton_Click handler is detected when users touch the button. Flick Gestures A flick is a simple touch gesture that can be interpreted as a keystroke command. The following table lists the flick gestures and default assignment in Windows Vista. Navigational flicks Editing flicks Flick Flick left Flick right Equivalent command Back command Forward command Enabled by default Flick up Keyboard Scroll Down one screenful Flick down Keyboard Scroll Up one screenful Flick up-left diagonal Flick down-left diagonal Flick up-right diagonal Flick down-right diagonal Keyboard Delete Keyboard Undo Keyboard Copy Keyboard Paste Not enabled by default (because these flicks are not natural and require more precision ) 8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

8
The following code fragment of a Windows Presentation Foundation (WPF)
application shows that the code to handle the users touching/tapping the exit
button is just the very same code that handles a mouse click to the exit button.
public Window1()
{
InitializeComponent();
//add the event handler to handle users click/tap the exit button
button1.Click += new RoutedEventHandler(exitButton_Click);
}
private void exitButton_Click(object sender, RoutedEventArgs e)
{
//close the window to exit the application
this.Close();
}
You may wonder why there is nothing relating to touch in this code. The operating
system synthesizes the tap or the touch on the exit button to the mouse left click
message, so no extra code is needed to handle the tap/touch to the button other
than the usual left mouse click event handler. When users use the mouse and left-
click on the button, exitButton_Click is detected. And the very same exitButton_Click
handler is detected when users touch the button.
Flick Gestures
A flick is a simple touch gesture that can be interpreted as a keystroke command.
The following table lists the flick gestures and default assignment in Windows Vista.
Flick
Equivalent command
Navigational flicks
Flick left
Back command
Enabled by default
Flick right
Forward command
Flick up
Keyboard Scroll Down
one screenful
Flick down
Keyboard Scroll Up one
screenful
Editing flicks
Flick up-left diagonal
Keyboard Delete
Not enabled by
default (because
these flicks are not
natural and
require more
precision )
Flick down-left diagonal
Keyboard Undo
Flick up-right diagonal
Keyboard Copy
Flick down-right
diagonal
Keyboard Paste