4 ms·
Please add `return false` or `event.preventDefault()` to your keyboard handlers! Otherwise the browser assumes the page didn't do anything with the events and
by pornel 6y ago
Please add `return false` or `event.preventDefault()` to your keyboard handlers!
Otherwise the browser assumes the page didn't do anything with the events and uses its default keyboard handlers. I have find-as-you-type enabled, and pressing keys launches search for me. Handlers need to "eat" the keyboard events to prevent default browser behavior.
- sedatk 6y agoAlso HN, please add "`" for inline monospace text.
- arthurcolle 6y agowhat? why? backtick code comments/snippets from source text are. really not widely standardized, I don't think it makes sense to encourage them without an accompanying web standard, or at least some kind of standard
- Rumudiez 6y agoHN isn’t a web standard.
- arthurcolle 6y agoThe markup that it uses for comments should use one though - and apparently it does! Others have mentioned that it uses a subset of CommonMark as mentioned in your post's sibling comments. Thanks
- ihuman 6y agoThe page with HN's formatting options is a bit hidden (in the FAQ). I'm not surprised people don't know about it. https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- snazz 6y agoI'd say that CommonMark is a pretty widely-utilized standard defining formatting including `inline code` snippets.
- arthurcolle 6y agoGotcha, didn't realize it was standardized. I feel like I heard about CommonMark when it first was announced and I more or less wrote it off as another markup format, but thanks for the clarification. My poor little internet points <\3 sorry HN for the unforgivable offense of asking a benign question
- deleted 6y ago[deleted]
- boogies 6y agoCommonMark is some kind of standard, and HN’s current syntax is a subset of it.
- grishka 6y agoAlso: I had Russian keyboard layout when I opened the link, and nothing at all worked. Switching to English fixed it. You should be using key codes, not characters, unless you're accepting text input. Key codes correspond to physical keys on the keyboard, but characters they type don't necessarily. edit: oh it's on github, gonna submit an issue
- dkersten 6y agoYes! I use colemak, so its rather annoying when there's games that assume WASD but use characters and don't let me rebind the keys.
- timdorr 6y agohttps://github.com/Externalizable/bongo.cat/pull/147 https://github.com/Externalizable/bongo.cat/pull/147