How to assign shortcut keys for a specific action

hi all
while surfing the yahoomail
I like the nice feature of shortcut keys (like for read mail {shift + K) / unread mail (k)}
Anybody know how to do this ?
Is it a javascript or may be any other thing ?

Thanks in advance