You are not logged in.

Read the FAQ and Knowledge Base before posting.
We won't make a 3DS/2DS emulator.

#1 Technical » RealTimeStylus support? (for tablet PCs) -- Looks like a trivial fix » 2010-02-13 17:28:07

Replies: 1

Desmume on a touch-screen tablet PC is a positively awesome idea, but touch events don't register 100% of the time. In fact, I have to scribble on an area to get Desmume to register a single touch -- and this doesn't work when you have to draw letters a la Scribblenauts, or even press buttons on Phoenix Wright. It gets annoying and tiring scribbling on a button, and I'd like Desmume to support RealTimeStylus. … tylus.aspx

See, what happens on tablets is that there's an "invisible window" layer that captures/manages your touches, and sends WM_LBUTTON events to whichever window you clicked. But since desmume is processor-intensive, it doesn't receive the generated WM_LBUTTON events all the time. NoGBA behaves the same. To circumvent this, you'd add a RealTimeStylus class to the window, so the window handles touch events directly. Therefore, you'd only need to click a DS button once, not scribble.

I tried adding it myself, but I can't figure out C/++ for the life of me (I'm PHP and C#, sorry!) Anybody mind figuring this out?
I think this should be relatively simple -- the basic idea is that RealTimeStylus captures your x and y coordinates and feeds that to ToDSScreenRelativeCoords(x,y,0) and NDS_setTouchPos(x, y) in main.cpp


TL;DR You need at least Windows SDK v6.0. (For my info, I use SDK v7.0)

API Doc: … tylus.aspx

Relevant RealTimeStylus sample: C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\tabletpc\realtimestylusplugin\cpp
More specifically: COMRTSDlg.cpp (can't link, it triggers spam filter)

I think what happens is that you init RealTimeStylus first (line 129), and then you init "plugins" that go into RTS -- starting with PacketFilter. Not sure if CustomRenderer, GestureRecognizer, and DynamicRenderer are needed.

InitPacketFilter (line 234) is inited, at which point you feed it the ClientRect so that pen events aren't recorded outside the window. Then it gets plugged into the "plugin collection"

And that's all I know so far. If someone were to supply me with MFC headers (VS2008 Express doesn't include them, so I can't compile,) I can figure out more smile

Board footer

Powered by FluxBB