.NET
  Home arrow .NET arrow Page 3 - Keyboard and Ink Input with WPF
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Keyboard and Ink Input with WPF
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-07-10

    Table of Contents:
  • Keyboard and Ink Input with WPF
  • Keyboard State
  • Ink Input
  • Commands

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Keyboard and Ink Input with WPF - Ink Input


    (Page 3 of 4 )

    The stylus used on Tablet PCs and other ink-enabled systems has its own set of events. Table 4-3 shows the ink input events offered by user interface elements.

    Table 4-3. Stylus and ink events

    Event

    Routing

    Meaning

    GotStylusCapture

    Bubble

    Element captured stylus.

    LostStylusCapture

    Bubble

    Element lost stylus capture.

    PreviewStylusButtonDown, StylusButtonDown

    Tunnel, Bubble

    Stylus button pressed while over element.

    PreviewStylusButtonUp, StylusButtonUp

    Tunnel, Bubble

    Stylus button released while over element.

    PreviewStylusDown, StylusDown

    Tunnel, Bubble

    Stylus touched screen while over element.

    PreviewStylusUp, StylusUp

    Tunnel, Bubble

    Stylus left screen while over element.

    StylusEnter

    Direct

    Stylus moved into element.

    StylusLeave

    Direct

    Stylus left element.

    PreviewStylusInRange, StylusInRange

    Tunnel, Bubble

    Stylus moved close enough to screen to be detected.

    PreviewStylusOutOfRange, StylusOutOfRange

    Tunnel, Bubble

    Stylus moved out of detection range.

    PreviewStylusMove, StylusMove

    Tunnel, Bubble

    Stylus moved while over element.

    PreviewStylusInAirMove, StylusInAirMove

    Tunnel, Bubble

    Stylus moved while over element but not in contact with screen. 

    PreviewStylusSystemGesture, StylusSystemGesture

    Tunnel, Bubble

    Stylus performed a gesture.

    PreviewTextInput, TextInput

    Tunnel, Bubble

    Element received text input.

    TheStylusclass provides a staticCapturemethod that works exactly the same as theMouse.Capturemethod described earlier. It also offersCaptured andDirectlyOverproperties that do the same for the stylus as the matching properties of theMouseclass do for the mouse.

    There is an alternative way of dealing with stylus input. Instead of handling all of these low-level events yourself, you can use WPF’s high-level ink handling element,InkCanvas. Example 4-14 shows how little is required to add an ink input area to a WPF application.

    Example 4-14. InkCanvas

    <InkCanvas />

    TheInkCanvas accepts free-form ink input. Figure 4-3 shows the InkCanvasin action. (It also demonstrates that I should probably stick to using the keyboard.)InkCanvasmakes all of the ink input available to your program through itsStrokes property. It is possible to connect this data to the handwriting recognition APIs in Windows, but that is beyond the scope of this book.


    Figure 4-3.  InkCanvas

    More .NET Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Programming WPF, Second Edition,"...
     

    Buy this book now. This article is excerpted from Programming WPF, Second Edition, written by Chris Sells and Ian Griffiths (O'Reilly, 2007; ISBN: 0596510373). Check it out today at your favorite bookstore. Buy this book now.

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT