apankrat / nullboard

Nullboard is a minimalist kanban board, focused on compactness and readability.
https://nullboard.io/preview
Other
2.52k stars 197 forks source link

Feat: add bullet shortcut for Mac users #59

Open conmcdon721 opened 2 years ago

conmcdon721 commented 2 years ago

I'm using nullboard on a Mac and couldn't figure out how to add bullet points. On line 4709 of nullboard.html, I found the shortcut for adding bullet points on Windows. I added an OR to the conditional so it includes the Mac's Command key.

In my OR conditional, I included both the Shift key and the 8 key. For some reason, the asterisk key wasn't working for me. Moreover, I used the Meta key instead of the Command key's key-code. I did this to minimize the necessary code: the left and the right Command keys have different key-codes, and the Command keys' key-codes are different for each browser.

The drawback to this addition is that Windows users may unintentionally create the event by pressing the Windows key, which is also a Meta key.

apankrat commented 1 year ago

Hi Connor,

Can you run a quick test for me? Add console.log(ev) at line 4709 (after // ctrl-shift-8), then hit Command-Shift-8, Command-8 and Command-* with * on the numpad. Then let me see the output from the dev console. Hardcoding * as Shift-8 seems somewhat hacky, so I'd like to see if there's a cleaner way.

The drawback to this addition is that Windows users may unintentionally create the event by pressing the Windows key, which is also a Meta key.

This is not an issue. Chances of anyone ever using Windows-* combo with the asterisk via Shift-8 are next to zero.