Comments (7)
Code at $85FC MAIN is used to detect double-clicks. It is called by DeskTop after an icon click (window or desktop), and it stashes the coords and starts a counter, then enters an input loop. If the counter hits zero, the cursor moves beyond a pixel threshold, or a non move/click event occurs it exits. If the event is a click it signals a double click.
The counter is initialized with machine-specific values (IIe = $12C, IIc = $1F4, IIgs = $1FA). These could be inflated although the counter decrement logic only handles values in the range $0 ... $1FF. (There's enough room to replace the counter initialization with larger but fixed values, e.g. $3FF, and generalize the counter decrement logic.)
If the counter is set to infinity (e.g. NOP out the checks) then basic click actions don't work until the mouse moves beyond the pixel threshold, so that's not an acceptable fix for arbitrary acceleration (e.g. an emulator running flat out) - there really does need to be a time limit.
from a2d.
Interestingly, there is a second, possibly unused implementation of the double-click detection code.
- The main one is at
desktop_main.s
$85FC and uses delta x/y of 8/7 andmachine_type
*2 as delta t. - The second is at
desktop_main.s
$B554 and uses delta x/y of 5/4 and themachine_type
*2 as delta t.
Related, there is insertion point blinking. There are again two implementations:
- One at main $A56C for the Rename/New Folder prompt; it uses a fixed value of $14 as delta t.
- One is in
ovl4.s
circa $5C60 and usesmachine_type
as the delta t.
Under Virtual ][ at normal speed, both have a cycle of about 1s, which is... weird.
The machine_type
field uses: IIgs=$FD, IIc=$FA, IIe=$96; presumably this correlates with the speed of the mouse firmware which affects the input loop.
from a2d.
The speed setting could also be used to slow down the open/close window animation on fast machines.
from a2d.
Crazy idea for emulators: since emulators slow down when sound is produced, toggle the speaker when initiating a double-click detection loop, and infrequently during the loop. There may be a sweet spot where it isn't audible, but slows the emulator enough.
from a2d.
The SPKR trick works in Virtual ][, although it induces a bit of UI jank on any click in a window
from a2d.
Correction to previous:
- There are two IP blinking implementations (one in
desktop_main.s
, one inovl4.s
, but both use hardcoded $14 value. - The routine in
ovl4.s
circa $5C60 is (yet another) a double-click detection routine, in the file picker dialog.
from a2d.
The settings should be appropriate for roughly 1MHz, 4MHz, and 32MHz systems (i.e. baseline IIe, accelerated IIc+/IIgs/Laser, and emulators/FastChip).
We can iterate and add more steps if needed.
from a2d.
Related Issues (20)
- This Apple DA: Probe SSC on //c for connected The Cricket! HOT 3
- Sort Directory doesn't order SYS files with ".SYSTEM" suffix
- Key commands for Disk Copy/Quick Copy DA HOT 3
- Display corrupted when returning from //GS Apps HOT 3
- Image preview causes crash to monitor HOT 1
- Disk Copy causes A2Stream not to work HOT 1
- Add Dutch localization HOT 2
- CD Remote shouldn't play on track up/down unless it's already playing HOT 13
- Rectangle inverted after dismissing alert HOT 1
- Previous lines of text disappears while scrolling down a text file in "Fixed" font HOT 3
- Monochrome mode broken on IIe Card HOT 7
- OpenApple-O not opening folder
- Scroll position adjusts even if thumb not moved HOT 4
- v1.4-alpha builds hang at startup in Crossrunner HOT 5
- Options control panel causes basic.system to crash HOT 1
- Sounds DA causes BASIC.SYSTEM to hang HOT 1
- Show.Text.File's Proportional/Fixed label baseline is 1px too high
- Replace thin apple glyph in menu bar with a fatter, more realistic Apple logo HOT 1
- Selector crash when loading with ProDos 2.4.3 HOT 13
- List view items paint as NON / 32,768 / No Date after showing/closing Shortcuts dialogs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a2d.