|
OK, Let me be sure I have this straight. If you implement both tap and double tap, and then you double tap the control, it raises the tap event and then the double tap event?
How is your code supposed to respond to the double tap appropriately if the single tap also happens, and happens first?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I've never worked on this kind of interface but am keen to guess.
I assume the double tap has to undo the effect of the single tap when necessary. The generator of the double tap appears to run a timer that raises the double tap event so that the recipient doesn't have to do this. Presumably the single tap event is raised first so that the user doesn't have to wait for the timeout, which could be annoying.
|
|
|
|
|
Yes; (single) tapped fires first and then double-tap fires; if both are implemented.
Double tap may or may not care what happens in single tap; that's up to the programmer.
I think we're used to thinking as "click" and double-click as being mutually exclusive. At one time, I think we may have had only single clicks, and we had to do the timing ourselves and decide when it should be handled as a double.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
You totally lost me with all the tap dancing. Luckily, I do not do UWP.
|
|
|
|
|
Assumption only - I have not touched UWP.
There should be a time setting between single and double tap!
If you get a single tap then the state should toggle.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
You're assuming this particular behavior is undesirable.
As I explained, it's doing exactly what I want it to do even though it doesn't fit a particular "mental model".
I got the same behavior on my Surface (touch pad) and my PC (mouse). Tap once: select "tapped" item; double-tap: select "that" item, and all others of the same type (with the understanding that "that" item was actually selected on the first tap, and the rest on the second tap i.e. the double tap event).
By changing "settings", you're implying I need to favor one event over the other, when in fact I need both. (That's the Zen part )
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Seems to be similar to click - double-click problem. If double-click is implemented, the best design is to assign double-click function, which is kind of addition to single click. For example, single click selects an object, and double-click opens it. Otherwise, different tricks with timeout usually give bad results.
|
|
|
|
|
While I thought there "should" be a problem having the 2 events, I've come to the conclusion it's not. In my case, the second event is just an extension of the first (select one versus many).
The "file click / double click" could just as easily be a select file (in single click) -> open selected file from single click (in double click).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I don't see the strangeness. That's how it's usually implemented, in Widnows Forms it's just hidden. In VB6 there were controls that didn't expose DblClick events and it had to be manually managed through MouseDown and MouseUp. It also had to be done if managing modifier keys (as Ctrl, Shift...).
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
I have no idea about UWP, but on other touch screen systems there is also "long tap", not to mention various forms of dragging and swiping...
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I assume a long tap occurs when the interval between "finger down" and "finger up" is sufficiently long, and that velocity distinguishes dragging from swiping.
A UI with limited inputs that relies on timing to define additional events can be a problem. Long ago, I worked in a group that was developing a new business phone. It could have two calls on the go, which would be on "A" and "B" keys. To conference the calls, you'd push A and B down together. This was eventually abandoned in favor of an explicit CONF key because you'd simply press A or B to flip from one call to the other. Having to press simultaneously introduced timeouts, delays, and possible errors. The corporate group that approved UIs decided that this wasn't good.
But even with a better UI, one gentleman managed to conference his wife and mistress...
|
|
|
|
|
The stork brings them, but that's not the interesting part. I want to see 3D graphics on an 8 bit computer, at least once I get around to build the graphics card. It's going to have a TMS9981 graphics chip, a RISC graphics processor and a DMA based DGP (Decelerated Graphics Port).
Anyway, I'm going to need some math routines for, let's say, 32 bit fixed point math. Will 24 bits for the whole numbers will be enough, but maybe just 8 bits for the fractions are not. We shall see. Anyway, I intend to use the Russian Peasant Multiplication[^] algorithm. It's based on multiplying and dividing by 2 (also known as shifting) and addition. That should be easy to implement. But what is the algorithm for division called? I'm going to need that as well.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
|
Certainly does. At least I now have all bases covered. But before I write the first code, I'm going to check the runtime behavior of the algorithms to pick the best choice. No time to waste on an old 8 bit CPU.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
It is always going to be a slow(ish) operation in software, that is why they brought out co-processors and eventually implemented it on the CPU.
Just remember when you multiply/divide the decimal point will move and you will need to normalise the result.
You might also look into doing binary square roots:
Methods of computing square roots - Wikipedia[^]
I have never used this myself, but there is code there, so that should help you assess the speed of it.
|
|
|
|
|
and I'm struggling with keypad and 7-segment display on my Z80 I'm building.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
What's the problem?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Keypad works fine(24 key), display works fine (7-segment 4 address, 2 data).
On reset I set display buffer to: FFFF FF
I then go into my main loop looking for keyboard input and when Data Available bit from keypad goes low I process the input and if it's a 0-F I put in address buffer if it's > 16 it's a function key and I process it as such.
For some reason on reset the system thinks that the data available bit is low and so I end up with display of; 0FFF FF.
I've put the scope on the DA pin and on reset it does not go low so not sure exactly what's going on. Not sure where to go from here as far as debugging.
For now Ive got it set up just to accept keypad input and put key input into 1st buffer position and if any function key pressed put 4444 44 into display buffer which it does just fine.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Put in a delay loop before entering the main loop and processing any inputs. It's just an idea, but your code may be faster than the I/O chip after a reset. Give it a little more time to get going.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Thanks I'll try that today, was working on honey-do list yesterday.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Turns out I needed to RTFM a little better.
I am using a 8255 (PIO) to talk to the keypad and display and was trying to use Mode 1 on Port A without doing the appropriate handshacking. So I put it in straight input mode 0 and it works like a charm.
Thanks for your feedback.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
People who used the as IDE controller ran into similar problems. That's why I plan to skip all I/O devices and will try to access the registers of the IDE devices directly, as memory mapped I/O devices themselves.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I'm beginning to learn the same thing.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
That sounds like the video chip that was used in the TI-99/4A home computer.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Exactly. Oldschool graphics chips suitable for 8 bit computers are hard to get.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|