any cool libraries that you know about around? 开发者_如何学Python=)
Hard to tell exactly what you're asking, but if you're handling an event that gives you a charCode, such as keypress, you can use
var str = String.fromCharCode(event.charCode);
// or
var str = String.fromCharCode(event.which);
to get the value of the key that was pressed.
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/fromCharCode
This jquery event.which example pretty much does what you want.
精彩评论