Haha, I've actually known about this problem for quite a while. It's been an issue since the first release of the webclient, actually.
Basically, there's no way to properly index macros by number keys. For example, the following will return a compilation error:
macro
1 return "do-key-1"
2 return "do-key-2"
/*
layout.dms:94:error at '1': expected end of macro block
layout.dms:94:error at '1': unexpected character
*/
The lazy workaround to this I've come up with is to define an event listener for "#skin" such event.which is between (49, 56) (which correspond to 1-9 on the keyboard). There seem to be some issues with event permutation, though, and the keys don't properly fire off all the time - which is why I'd prefer to be able to just define them via a .dms file.