Live data from Hacker News

Tldraw – a tiny little drawing app

tldraw.com

11–20 of 115 posts

Re: Tldraw – a tiny little drawing app

#17

Sorry, since this was posted a month ago ( https://news.ycombinator.com/item?id=28854949 ) highlighting that it was sponsorware. It is now open-sourced and free also.

Saving a Google search for the uninitiated (me):

``` Simply stated, the “Sponsorware” model for releasing a project is made up of a few simple steps:

    Build something people want! – This is easier said than done, but we believe this model works best for open source projects with significant pre-release hype. The more interest you are able to build in your product before launch, the better your results are likely to be.

    Make it available only to “sponsors” – These “sponsors” are people who give you recurring revenue. This can be through any of the big sponsorship platforms (i.e. - GitHub Sponsors, Patreon, OpenCollective, etc.) or it can be a system you roll yourself. The important parts are A) that the revenue is recurring, and B) that either your number of sponsors or your net revenue is publicly viewable

    Set a sponsorship threshold, and after crossing it, make your thing freely available to the world! – This can be a number of monthly sponsors, an amount of monthly revenue, or whatever you like. It should be PUBLIC though. Transparency is huge in this process and people need to be able to see progress toward the goal.
``

Re: Tldraw – a tiny little drawing app

#18

Very nice. What API is used to track Shift/Ctrl/Alt keys state?

There is the standard event.getModifierState() API, but the most reliable solution I found was to listen for "keydown", "keyup", "blur", "pointerdown", "pointermove" and "pointerup" events on the window object and then store the modifier keys state based on the value of event.ctrlKey/altKey/metaKey/shiftKey.

You need to listen for the pointer events because some devices such as Wacom tablets do not dispatch proper keyboard events when you press a button that has a modifier key role assigned to it.

On Apple devices event.metaKey represents the state of the command key, so in most scenarios you would be storing the state as: let ctrlOrCmd = (isAppleDevice ? event.metaKey : event.ctrlKey);

Post reply on HN