Boostnote: Shift / ctrl key introducing asterisks

Created on 2 May 2017  路  4Comments  路  Source: BoostIO/Boostnote

I hope this can be re-produced on your end.

When using markdown editor, try typing:

"hello:"

then pressing "ctrl+n" (for e.g. ) or just ctrl... in my case I get asterisks inserted (not always)... I use (ctrl + n, ctrl + p, ctrl + a, ctrl + e) from muscle memory to go to the next line, go to the previous line, go to the beginning of a line, and go to the end of a line.

asterisks-issue

Most helpful comment

How to reproduce this bug:
(note the distinction between the ; key and the : key)
hold down shift + ; and then release shift before releasing ; then try hitting ctrl. You will get asterisks. (ctrl + :) is the shortcut for surrounding words with asterisks (bolding).

This happens because of how Boostnote detect multiple keys. When you hold down shift + ;, shift and : are registered as being "down" but then if you release shift first before releasing ;, then Boostnote will only detect that shift and ; are released (instead of :, because : is shift + ;), but internally the : key is still registered as being held down even though it has already been released. For : to be detected as released, both shift and ; have to be released at the same time or ; before shift.
So if you hit ctrl after, you get asterisks, which is ctrl + :

This is a tough one to explain but here's the internal key states when this bug occurs:

  • hold down shift + ;
    keys that are down: {Shift: true, :: true}

  • release shift:
    keys that are down: {Shift: false, :: true}

  • release ; :
    (by now both keys are up)
    keys that are down: {Shift: false, :: true} (because ; is detected as released, NOT :)

  • hit ctrl now:
    keys that are down: {Shift: false, :: true, Control: true}
    Hence you get asterisks.

This isn't really limited to shift + ;, it could happen to any characters that require holding down shift.
I'll look for a way to fix it in the mean time.

All 4 comments

I also encountered this issue, which is extremely annoying. I usually trigger it when pasting text into notes.

It occurs at some point while editing notes, and seems to be triggered by first typing ':' and then pressing the control key. After it is first triggered, each press of the control key triggers the 'bold syntax' around text near the cursor. Moving the input focus away from the editor makes the editor behave normally next time it used.

@justin-calleja could you please check if you can trigger the issue the way I can? If that is the case then please update the issue title to reflect that the control key triggers the bug, and not the shift key.

How to reproduce this bug:
(note the distinction between the ; key and the : key)
hold down shift + ; and then release shift before releasing ; then try hitting ctrl. You will get asterisks. (ctrl + :) is the shortcut for surrounding words with asterisks (bolding).

This happens because of how Boostnote detect multiple keys. When you hold down shift + ;, shift and : are registered as being "down" but then if you release shift first before releasing ;, then Boostnote will only detect that shift and ; are released (instead of :, because : is shift + ;), but internally the : key is still registered as being held down even though it has already been released. For : to be detected as released, both shift and ; have to be released at the same time or ; before shift.
So if you hit ctrl after, you get asterisks, which is ctrl + :

This is a tough one to explain but here's the internal key states when this bug occurs:

  • hold down shift + ;
    keys that are down: {Shift: true, :: true}

  • release shift:
    keys that are down: {Shift: false, :: true}

  • release ; :
    (by now both keys are up)
    keys that are down: {Shift: false, :: true} (because ; is detected as released, NOT :)

  • hit ctrl now:
    keys that are down: {Shift: false, :: true, Control: true}
    Hence you get asterisks.

This isn't really limited to shift + ;, it could happen to any characters that require holding down shift.
I'll look for a way to fix it in the mean time.

@sferra , you're right I meant ctrl key when I first opened the issue - my bad. Kept shift in the title because of @LeoLamCY 's findings.

@LeoLamCY I was able to re-produce:

hold down shift + ; and then release shift before releasing ; then try hitting ctrl

Thanks, I'm looking at #545

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shunchuan picture shunchuan  路  3Comments

N2ITN picture N2ITN  路  3Comments

necan picture necan  路  3Comments

NonlinearFruit picture NonlinearFruit  路  3Comments

Ocanamat picture Ocanamat  路  3Comments