Marshall E. Fryman wrote: > I'm not sure I followed your explanation all that well. Here's the > routine that I use (uses all bitwise operations and it's local so it's > very fast): > > procedure KeyToComponent(lparam:integer; var scan, rpt:integer; var > keydown:boolean); > begin > scan:=(lparam and $00FF0000) shr 16; //gets the third byte value from a > four byte integer > keydown:=(lparam and ($1 shl 29)) <> 0; //test bit 30 to see if it's set > rpt:=lparam and $FFFF; //gets the first two bytes > end; > > Could you show how you would do it?
What you've shown is probably how I would do it. Or I might use the functions in the JclLogic unit. > I'm not familiar with LoWord and > HiWord operators, I always just use pure bitwise operators. To avoid having to explain how bitwaise operations work, I suggested using the functions, so there is a mnemonic saying "this fetches the high byte," for instance. LoWord and hiWord aren't operators. They're functions. (Actually LoWord isn't even that; it's an alias for the Word type.) They're in Windows.pas because they're translations of Platform SDK macros. -- Rob __________________________________________________ Delphi-Talk mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi-talk
