Live data from Hacker News

Why is the mouse cursor slightly tilted and not straight?

ux.stackexchange.com

71–80 of 107 posts

Re: Why is the mouse cursor slightly tilted and not straight?

#71
It's interesting to see how misinformation propagates.

The second-highest-rated answer on Stack Exchange (46 votes and climbing) claims that another reason for the left arrow cursor in early GUIs was to put the hotspot at (0,0) to save time in the mouse position calculations:

http://ux.stackexchange.com/a/52349/43259

The answer cites this Reddit comment as its source:

http://www.reddit.com/r/explainlikeimfive/comments/1qhzym/wh...

That comment is a direct copy of this Yahoo! Answers comment from 2009, which says that the Xerox Alto worked this way, but cites no source for the claim:

http://answers.yahoo.com/question/index?qid=20090520113724AA...

In fact, the Alto did have multiple cursor shapes, and the hotspot wasn't always at (0,0). For example there was this cross in a circle:

http://www.guidebookgallery.org/articles/thexeroxaltocompute...

and a right-pointing arrow:

http://toastytech.com/guis/saltobravo.png

Let's ballpark the CPU overhead. According to this article, the Alto executed about 400,000 instructions per second, with an instruction set modeled after the Data General Nova 1220:

http://www.guidebookgallery.org/articles/thexeroxaltocompute...

Here's a brief description of the Nova instruction set:

http://users.rcn.com/crfriend/museum/doco/DG/Nova/base-instr...

There are four accumulators, with an ADD instruction that adds one accumulator to another (and a similar SUB). There are LDA and STA instructions that load and store memory, addressed with a displacement and an optional accumulator (e.g. to access into a structure using a pointer).

It seems reasonable to assume that at some point in the mouse refresh code, we will have the mouse's X value in one accumulator, and a pointer to the cursor structure (containing the cursor bitmap, hotspot, etc.) in another.

So to adjust our X value using the hotspot X from our cursor structure, we simply need an LDA to load the hotspot X into another accumulator, and an ADD or SUB to do the calculation. Repeat that for Y, and we've added a total of four instructions.

At 400,000 instructions per second, these calculations would add a 1/100,000 second overhead to the mouse calculation.

A worst case might be that we don't have a free accumulator when we need it. So that would be another STA and LDA to spill one temporarily.

If we have to do that for both X and Y, it would put us at eight instructions total, or 1/50,000 second.

Still probably worth doing it to get the flexibility of custom cursor hotspots. :-)

Re: Why is the mouse cursor slightly tilted and not straight?

#72
post #53

I don't know if this went into the decision making process, but with the cursor at an angle the OS can use the x,y coordinates of the cursor to find it's target, instead of having to offset the coordinates to compensate for a straight cursor. I'm not sure if that's how cursors work.. just a thought. edit: grammar is hard

Macintosh cursors were configurable right back to the beginning; the hot spot could be anywhere in the cursor's 16x16 rectangle. The text insertion point cursor had the hot spot centered and on the baseline, the crosshairs had it in the center, and so on. I have heard that it was the same in Windows, from the beginning. So the location of the arrow cursor's hotspot in the top left is a result of that being the arrow's tip and not a cause of the arrow tip being located there.

Re: Why is the mouse cursor slightly tilted and not straight?

#73
post #62

Earlier quoted context omitted.

Things that would appear ideal would be something like either a Light Pen or a Touch screen. Mainly because they'd appear ideal since that's how we interacted with things before computers, so it should enable us to work with computers the same way that we interact with things of the past 5k years or so. that said it's just appearances.

Touch screens where tried and rejected by the military early on because people hands would get tired after a very short time interacting with a vertically mounted touch screen. Horizontal touch screens have other usability challenges.

Plus, they get dirty, and resolution is much worse - try to make pixel-resolution actions with touch, it's practically impossible. With the mouse, much easier. And, replacing a cheap mouse is much better than replacing an expensive high-resolution screen.

Re: Why is the mouse cursor slightly tilted and not straight?

#76
post #63

Earlier quoted context omitted.

Things that would appear ideal would be something like either a Light Pen or a Touch screen. Mainly because they'd appear ideal since that's how we interacted with things before computers, so it should enable us to work with computers the same way that we interact with things of the past 5k years or so. that said it's just appearances.

I don't know much about light pens, but it seems from the Wikipedia article https://en.wikipedia.org/wiki/Light_pen that they are primarily intended for use with CRT monitors, which limits their utility nowadays. Touch screens are obviously very much modern devices, and, though they're far from ideal as the only input device, I can buy that, when used in conjunction with a keyboard, they are a good replacement for a…

Yea light pens were originally a way to add something like a touch screen to CRTs way back in the "old days" long before alternative displays were feasible let alone better. As far as touch screens using power, they don't as I've known, or at least they don't have too. the same tech that makes up touchpads is usable to make touch screens (and in fact it is on your smartphone and tablet). That may not have been true back with the resistive touch sensors such as those on the palm pilot and such.

Re: Why is the mouse cursor slightly tilted and not straight?

#77

Earlier quoted context omitted.

But the arrow cursor is not used for selecting text. The cursor switches to an I-beam over selectable text. This was the case as far back as the original Mac; I'm not sure which cursors were used on systems before that.

Not all on-screen text is selectable!

And that's a problem at least an order of magnitude more serious than which few pixels the cursor is covering.

Re: Why is the mouse cursor slightly tilted and not straight?

#78
post #40

still no way to change the cursors under mac os x ?

I've changed my cursors under OS X for a long time now. Check out /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HiServices.framework/Versions/A/Resources/cursors for the special ones. (People make replacement packs that are drop-in replacements for the cursor image files.) For the main cursor, use a combination of Cursorcerer and HotMouse.

so no, no official way to change that main cursor.

Re: Why is the mouse cursor slightly tilted and not straight?

#79
post #40

still no way to change the cursors under mac os x ?

I've changed my cursors under OS X for a long time now. Check out /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HiServices.framework/Versions/A/Resources/cursors for the special ones. (People make replacement packs that are drop-in replacements for the cursor image files.) For the main cursor, use a combination of Cursorcerer and HotMouse.

> Check out /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HiServices.framework/Versions/A/Resources/cursors

Wow. Of all the good that OSX inherited from UNIX, why did it have to wreck any notion of a reasonable directory structure?

Re: Why is the mouse cursor slightly tilted and not straight?

#80

pointer

Actually, I'm wrong. Turns out pointer and caret are subclasses of cursor, and "mouse cursor" is perfectly acceptable to refer to the former. You learn something by being a petty smartass :)

...besides, when I hear the word pointer mentioned within the context of computing, I'm more inclined to think of things like stack pointers and instruction pointers.
Post reply on HN