setting hotkeys on the fly

Hi there, I

would like to create a script in 3ds max that would set and get hotkeys for commands without getting in customize UI. It would work like in zbrush. You would press some key (ctrl or something) and click on some button and than it would listen the keys you press next. Then it would insert a line in kbd. file with that command and keys. Same for showing a hotkey.

I have two problems, which I dont know if it could be solved. First, if you want to start using new hotkey, you would have to load that kbd file. Is there a way to automating this somehow? Second, is there a way to catch a command in maxscript. For example when I click on some macro, maxscript listener shows me: "Modifier Stack" "Convert_to_Poly" Is it possible to catch it in maxscript?

It would allow for really flexible workflow. When you need to use some command only temporarily, you can set a hotkey for it very quickly. Also when you dont remember a hotkey for some command it would show it for you. thanks in advance....Jan