Technology Questions

Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC Software > Tablet PC Developers

Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 11-02-2007, 10:20 AM
Steve Niles
Newsgroup Contributor
 
Posts: n/a
On CursorInRange event - how to determine whether stylus or mouse

I need my application to react differently when a the mouse clicks on a text
field in my application, as opposed to the stylus. The CursorInRange doesn't
seem to have anything in it that lets me determine this. Is there any way?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 11-02-2007, 10:20 AM
  #2 (permalink)  
Old 11-02-2007, 05:20 PM
Josh Einstein
Newsgroup Contributor
 
Posts: n/a
Re: On CursorInRange event - how to determine whether stylus or mouse

You have a couple of options.

1) You can create a RealTimeStylus (refer to the docs for how to use this)
and pass false to the "useMouseForInput" parameter in the constructor. This
way, none of the RealTimeStylus events will be fired for the mouse device.

2) You can let the RealTimeStylus handle the mouse events too by passing
true to the above mentioned parameter, then in the StylusInRange event,
check the e.Stylus.TabletContextId property which will correspond to one of
the installed tablet devices (the mouse is emulated as a separate tablet
device from the Wacom)

3) You can use a simple API "GetMessageExtraInfo" while handling the click
event. This will get extra data that WISPTIS added to the synthesized
WM_LBUTTONDOWN message (or didn't add if it was generated by an actual
mouse). The code for doing that would look like this:

if ( ( GetMessageExtraInfo() & 0xFF515700 ) == 0xFF515700 )
{
// click was generated by wisptis (the service that converts pen into
mouse movements)
}
else
{
// click was generated by the mouse
}

--
Josh Einstein (Tablet PC MVP)
Einstein Technologies
Tablet Enhancements for Outlook - Try it free: www.tabletoutlook.com

"Steve Niles" <SteveNiles@discussions.microsoft.com> wrote in message
news:BB015BB3-EE39-4098-BCAB-E3C478CEE1D4@microsoft.com...
>I need my application to react differently when a the mouse clicks on a
>text
> field in my application, as opposed to the stylus. The CursorInRange
> doesn't
> seem to have anything in it that lets me determine this. Is there any
> way?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 11-04-2007, 06:30 AM
Stefan Wick[MS]
Newsgroup Contributor
 
Posts: n/a
Re: On CursorInRange event - how to determine whether stylus or mo

A few more additional things that might be helpful:

4) the CursorInRange event actaully does tell you what device is being used:
check the Cursor.Name property - or inspect the Cursor.Tablet object for all
device details.

5) you can do the same what Josh described as option #1 below when using
InkOverly or InkPicture by calling the SetSingleTabletIntegratedMode() API [1]

6) if your stylus (or touch) device is not a proper, HID compliant device
then none of these techniques will work. The device will look like a mouse to
the system.

Thanks,
Stefan Wick - http://blogs.msdn.com/swick

[1]
http://msdn2.microsoft.com/en-us/lib...ratedmode.aspx

"Josh Einstein" wrote:

> You have a couple of options.
>
> 1) You can create a RealTimeStylus (refer to the docs for how to use this)
> and pass false to the "useMouseForInput" parameter in the constructor. This
> way, none of the RealTimeStylus events will be fired for the mouse device.
>
> 2) You can let the RealTimeStylus handle the mouse events too by passing
> true to the above mentioned parameter, then in the StylusInRange event,
> check the e.Stylus.TabletContextId property which will correspond to one of
> the installed tablet devices (the mouse is emulated as a separate tablet
> device from the Wacom)
>
> 3) You can use a simple API "GetMessageExtraInfo" while handling the click
> event. This will get extra data that WISPTIS added to the synthesized
> WM_LBUTTONDOWN message (or didn't add if it was generated by an actual
> mouse). The code for doing that would look like this:
>
> if ( ( GetMessageExtraInfo() & 0xFF515700 ) == 0xFF515700 )
> {
> // click was generated by wisptis (the service that converts pen into
> mouse movements)
> }
> else
> {
> // click was generated by the mouse
> }
>
> --
> Josh Einstein (Tablet PC MVP)
> Einstein Technologies
> Tablet Enhancements for Outlook - Try it free: www.tabletoutlook.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 11-05-2007, 12:00 PM
Steve Niles
Newsgroup Contributor
 
Posts: n/a
Re: On CursorInRange event - how to determine whether stylus or mo

Thanks so much to both Stefan and Josh. This is tremendously helpful!!

"Stefan Wick[MS]" wrote:

> A few more additional things that might be helpful:
>
> 4) the CursorInRange event actaully does tell you what device is being used:
> check the Cursor.Name property - or inspect the Cursor.Tablet object for all
> device details.
>
> 5) you can do the same what Josh described as option #1 below when using
> InkOverly or InkPicture by calling the SetSingleTabletIntegratedMode() API [1]
>
> 6) if your stylus (or touch) device is not a proper, HID compliant device
> then none of these techniques will work. The device will look like a mouse to
> the system.
>
> Thanks,
> Stefan Wick - http://blogs.msdn.com/swick
>
> [1]
> http://msdn2.microsoft.com/en-us/lib...ratedmode.aspx
>
> "Josh Einstein" wrote:
>
> > You have a couple of options.
> >
> > 1) You can create a RealTimeStylus (refer to the docs for how to use this)
> > and pass false to the "useMouseForInput" parameter in the constructor. This
> > way, none of the RealTimeStylus events will be fired for the mouse device.
> >
> > 2) You can let the RealTimeStylus handle the mouse events too by passing
> > true to the above mentioned parameter, then in the StylusInRange event,
> > check the e.Stylus.TabletContextId property which will correspond to one of
> > the installed tablet devices (the mouse is emulated as a separate tablet
> > device from the Wacom)
> >
> > 3) You can use a simple API "GetMessageExtraInfo" while handling the click
> > event. This will get extra data that WISPTIS added to the synthesized
> > WM_LBUTTONDOWN message (or didn't add if it was generated by an actual
> > mouse). The code for doing that would look like this:
> >
> > if ( ( GetMessageExtraInfo() & 0xFF515700 ) == 0xFF515700 )
> > {
> > // click was generated by wisptis (the service that converts pen into
> > mouse movements)
> > }
> > else
> > {
> > // click was generated by the mouse
> > }
> >
> > --
> > Josh Einstein (Tablet PC MVP)
> > Einstein Technologies
> > Tablet Enhancements for Outlook - Try it free: www.tabletoutlook.com

>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Viewer - Send e-mail after an event id is logged. techjohnny@gmail.com Windows XP 2 10-12-2007 02:40 PM
Event ID 4614 Event Viewer; Applications Hazyday Windows XP 6 09-19-2007 03:30 PM
outlook 2007 error event id: 35 Failed to determine if the store i Frank Windows Vista 1 08-22-2007 11:10 PM
right mouse function with stylus dlazenby Windows XP Tablet PC Newsgroup 1 05-15-2007 10:00 PM
Windows Event Log fails to translate event description. Deepak Jha Windows Vista 0 01-02-2007 11:06 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 10:00 AM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0