Chapter 8. Human input

 

This chapter covers

  • Capturing keystrokes
  • Responding to mouse clicks, movement, and the wheel
  • Handling multi-touch input
  • Working with pen ink input

Real-world applications need a way to accept input from users. This process of collecting input is managed by a wide range of input devices including the mouse, touch, stylus, and keyboard. Silverlight provides direct support for these devices through the System.Windows.Input namespace.

Whether you’re implementing drag and drop or mouse-wheel zoom or creating your own right-click context menus, you’ll almost certainly end up handling mouse input in your applications. Silverlight has great support for mouse states as well as for handling both left and right mouse buttons and allowing you to respond to the mouse wheel.

Multi-touch is now coming of age due to the proliferation of multi-touch devices, PC displays, and notebooks available to us. Silverlight can now accept single and multi-touch input to allow you to write next-generation touch-enabled applications.

If you have a tablet PC, an external drawing pad, or perhaps one of the newer tablet form factors that we’re just dreaming about as I write this, then ink input using a stylus is a must. Ink is also a nice way to capture drawings done with the mouse.

8.1. Capturing the keyboard

 
 

8.2. Mouse input

 

8.3. Using multi-touch

 
 
 
 

8.4. Collecting ink drawings

 
 
 
 

8.5. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage