How does AT forums intercept keyboard shortcuts for inserting BBCode tags? (Ctrl+B)

Ichinisan

Lifer
Oct 9, 2002
28,298
1,236
136
PHPBB forums like Anandtech and Slickdeals support keyboard shortcuts like Ctrl+B / Ctrl+ U / Ctrl+I to wrap appropriate BBCode tags around your selected text (doesn't work if you use Chrome).

I've looked at page source and can't figure out how it's done. There's no ' accesskey="b" ' or anything like that.

...so how's it done?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,835
4,815
75
While I don't know for sure, I'd guess it's an onkey event (e.g. onkeyup), like this.