![]() |
| | #1 |
| Code Warrior Join Date: Nov 2001
Posts: 669
| I noticed that if I have a mouse enabled in my console program and even if I do not move the mouse, it's still moving in some way (it seems that windows are refreshing the mouse every 500ms, i think). I know this beacuse I'm checking the MOUSE_MOVED message. I was checking the MSDN library but I found nothing. Anyone knows how to disable a mouse in a console with the WINAPI functions?
__________________ Current projects: 1) User Interface Development Kit (C++) 2) HTML SDK (C++) 3) Classes (C++) 4) INI Editor (Delphi) |
| GaPe is offline | |
| | #2 |
| Registered User Join Date: May 2002
Posts: 18
| Rather than that, couldn't you just make it so the user can only use the keyboard (i.e.- don't provide any mouse support)?
__________________ alpha561 "You don't want to sell me death sticks" |
| alpha561 is offline | |
| | #3 |
| &TH of undefined behavior Join Date: Aug 2001
Posts: 5,220
| To kill the cursor on a console I think you need to be in full screen mode...... You might want to look at a full Win32 app if you want more functionality
__________________ "If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut." Albert Einstein (1879 - 1955) Board Rules |
| Fordy is offline | |
| | #4 |
| Code Warrior Join Date: Nov 2001
Posts: 669
| alpha561 NO WAY! The keyboard and the mouse are already completely coded. Now, I'm debbuging some things, like this for example. Fordy You misunderstood the question. I do not want to kill the cursor, I just want to disable the mouse.
__________________ Current projects: 1) User Interface Development Kit (C++) 2) HTML SDK (C++) 3) Classes (C++) 4) INI Editor (Delphi) |
| GaPe is offline | |
| | #5 |
| &TH of undefined behavior Join Date: Aug 2001
Posts: 5,220
| Then you want to stop the system sending your app mouse messages?.... You cant!! That is beyond the scope of your application.... What problem is it causing you?
__________________ "If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut." Albert Einstein (1879 - 1955) Board Rules |
| Fordy is offline | |
| | #6 |
| Code Warrior Join Date: Nov 2001
Posts: 669
| There must be a way. I read something about the MOUSE_ENABLE_INPUT in the MSDN library but I don't know if this is it. The problem is, uf that will be hard to explain. You try that and you'll get it. Point your mouse on the menu, doesn't matter in which application you'll do that, click the command (FILE menu for example) and the menu will expand (will be opened). Now if you go with your mouse over some command, the command will than be selected. Now you leave your mouse alone and just use the keyboard (keys UP and DOWN) for selecting other commands. Now you see that, let's say, when you leave your mouse alone it was pointing on a command A. Then you press a key (UP or DOWN) and now the selected command is command B. In Windows application you'll notice that the command A will never get selected until you'll move the mouse or use the keyboard. This is the problem in my console application. The mouse is pointing on a command A and when I use the keyboard, the command B will get selected but after 0.5 s, the command A will be again selected. I hope this will help you to understand better my problem .
__________________ Current projects: 1) User Interface Development Kit (C++) 2) HTML SDK (C++) 3) Classes (C++) 4) INI Editor (Delphi) |
| GaPe is offline | |
| | #7 |
| Registered User Join Date: Oct 2001
Posts: 522
| Not sure how accurate this is but you can set the console mode Code: SetConsoleMode( hStdin, ENABLE_LINE_INPUT ); Code: SetConsoleMode( hStdin, ENABLE_MOUSE_INPUT ); Hope that helps
__________________ All spelling mistakes, syntatical errors and stupid comments are intentional. |
| C_Coder is offline | |
| | #8 |
| Code Warrior Join Date: Nov 2001
Posts: 669
| I think this is the way but I have one HUGE problem. When the user is using the keyboard (UP, DOWN and RETURN keys) then the mouse will be disabled. And if the user is using mouse the keyboard will be disabled. I think this is impossible to code, beacuse if I disable the mouse, then how to enable it when the mouse moved or the button was clicked if the mouse is disabled?
__________________ Current projects: 1) User Interface Development Kit (C++) 2) HTML SDK (C++) 3) Classes (C++) 4) INI Editor (Delphi) |
| GaPe is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Console Mouse and Key Input | Yuri | C++ Programming | 3 | 02-18-2006 04:56 PM |
| Change colour of screen and disable mouse | Meesa | C Programming | 2 | 05-18-2004 07:55 AM |
| Mouse Wheel In Console | GaPe | C Programming | 0 | 09-07-2002 02:05 AM |
| Mouse support in console mode | GaPe | C Programming | 1 | 04-17-2002 05:15 AM |
| Mouse in console | vasanth | C++ Programming | 0 | 02-05-2002 11:32 PM |