Win32Lib Changes
- Posted by "Cuny, David" <David.Cuny at DSS.CA.GOV> Sep 17, 1999
- 483 views
I've decided that I need to add the shift key parameters to the key and mouse events. This will break a lot of code, but it's something that I should have done a long time ago anyway. I could either go with the Visual Basic form of: onMouse( integer event, integer shift, integer x, integer y ) or like this: onMouse( integer event, integer x, integer y, integer shift ) Is there any preference to the order of parameters? Obviously, the onKey events will follow the same format. Additionally, I'm pretty tempted to fold the onKeyDown/Press/Up into a single routine, like so: onKey( integer event, integer keyCode, integer shift ) in the same way that I did to make onMouse a single function. Is this a bad idea? Would people prefer that I split the onMouse trap back into onMouseDown/Move/Up as it is in Visual Basic? Part of the problem is that Window's handling of keys isn't very portable, and it's a bit irritating. All keys are passed as raw scan codes to onKeyDown/Up, while onKeyPress sees ANSI keys - but no 'special' keys. Argh. My personal preference would be something like this: onKey( integer event, integer keyCode, integer shift ) where 'event' would either be KeyUp/KeyDown, and keyCode would be the ANSI value of a key (if it were a normal key), or a key code representing a 'special' key. I may hack it myself, but I'm a bit worried about international keyboards. Comments? Thanks! -- David Cuny