|
mouse_b problem |
bendenote
Member #7,842
October 2006
|
Hi; I am using so: at the top of program; install_mouse(); and after if(mouse_b&0) when program run, i don't see anything in console. |
Richard Phipps
Member #1,632
November 2001
|
Try the mouse example and see if that works for you first. |
miran
Member #2,407
June 2002
|
Did you set gfx mode or not? EDIT: Also you got the logic wrong. mouse_b&0 doesn't make sense. It's mouse_b&1 for left and mouse_b&2 for the right button (middle button is mouse_b&4). -- |
bendenote
Member #7,842
October 2006
|
All of my code #include <allegro.h> int get_mouse(void){ int main(int argc, char *argv[]){ |
miran
Member #2,407
June 2002
|
Quote: What can I do? You can start by using code tags. EDIT: What do you expect your code to do? It makes no sense. Here's some sample code that does work:
-- |
bendenote
Member #7,842
October 2006
|
Thanks miran I try your code. Mouse works. Default variable was "left side is pressed". So it couldn't display screen. when I correct so while loop it works: while(!key[KEY_ESC]){ |
GullRaDriel
Member #3,861
September 2003
|
bendenote: please use the code tags "Code is like shit - it only smells if it is not yours" |
bendenote
Member #7,842
October 2006
|
sorry |
GullRaDriel
Member #3,861
September 2003
|
You can edit your thread you know, and just add the right tag around your piece of code will make them looking as nice as the one you can see in Miran's post. The edit button is the second one following "Posted on 10-10-2006 14:31" in each of your posts. Don't be that sorry. I was doing the same when I was just coming here. In fact, the code-tags also have a nice utility: each function who is in the allegro manual is shown in blue and is in fact a link into the function documentation in the manual. It is also better because of syntax coloration, and it will not "eat" your indentation. Looking at it will be better for us. :-) "Code is like shit - it only smells if it is not yours" |
Sirocco
Member #88
April 2000
|
Out of curiosity, does Allegro pick up scroll wheel clicks as well (i.e. depressing the scroll wheel instead of rolling it)? --> |
Richard Phipps
Member #1,632
November 2001
|
I think that counts as a middle button click? |
Sirocco
Member #88
April 2000
|
Hmm... I'll have to try that out later and see. I've got a few situations where that could come in handy. --> |
Evert
Member #794
November 2000
|
What the blue monster said. |
Dale M.A. Johnson
Member #1,103
March 2001
|
Quote: Out of curiosity, does Allegro pick up scroll wheel clicks as well (i.e. depressing the scroll wheel instead of rolling it)? As in pressing the scroll wheel as a button? Yes, it does. Unless I'm mistaken, just use mouse_b & 4 ------> SIG TIME! "You know, I could be working on that battle engine... But NOOOO~, I'm too busy tweaking the title page." -Me |
Thomas Fjellstrom
Member #476
June 2000
|
First off, tell me what you think may be wrong with that? ... Yup, its that printf in the middle there, which will be printed every single loop, as you forgot to put it inside the {}s for mouse_b&1. Indentation and proper formatting really, really helps. -- |
|