怎么判断是左建还是右建,点击?
谢谢哦<P>程序例:</P>
<P>#include <stdio.h> <BR>#include <bios.h> <BR>#include <ctype.h> </P>
<P>#define RIGHT 0x01 <BR>#define LEFT 0x02 <BR>#define CTRL 0x04 <BR>#define ALT 0x08 </P>
<P>int main(void) <BR>{ <BR> int key, modifiers; </P>
<P> /* function 1 returns 0 until a key is pressed */ <BR> while (bioskey(1) == 0); </P>
<P> /* function 0 returns the key that is waiting */ <BR> key = bioskey(0); </P>
<P> /* use function 2 to determine if shift keys were used */ <BR> modifiers = bioskey(2); <BR> if (modifiers) <BR> { <BR> printf("["); <BR> if (modifiers & RIGHT) printf("RIGHT"); <BR> if (modifiers & LEFT) printf("LEFT"); <BR> if (modifiers & CTRL) printf("CTRL"); <BR> if (modifiers & ALT) printf("ALT"); <BR> printf("]"); <BR> } <BR> /* print out the character read */ <BR> if (isalnum(key & 0xFF)) <BR> printf("'%c'\n", key); <BR> else <BR> printf("%#02x\n", key); <BR> return 0; <BR>} </P>
我个人的意见是:<BR>void __fastcall TForm1::Memo1MouseDown(TObject *Sender,<BR> TMouseButton Button, TShiftState Shift, int X, int Y)<BR>{<BR> if(Button==mbLeft)<BR> <BR> { <BR> //你要做出的处理<BR> }<BR> if(Button==mbRight)<BR> {<BR> //你要的处理<BR> }<BR>}<BR>
页:
[1]
