mousebutton()

Linux specific forum
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

mousebutton()

Post by bernardfrancois »

hi,
Syntax

Result = MouseButton(ButtonNumber)
Description

Returns 0 if the specified button (1 for the left mouse button, 2 for the right mouse button) is not pressed, else the button is pressed. Any number of buttons can be pressed at the same time. ExamineMouse() must be called before this function to update the actual button's state.
Supported OS

Windows, AmigaOS
Seems this command isn't supported in the Linux version. Anyone who knows a command doing the same, working both for the Windows as Linux version?

Thanks in advance...
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

Post by bernardfrancois »

oh, and also... it should work without the initmouse() command (because this needs openscreen() or openwindowedscreen(), which hasnt been used)
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

Post by bernardfrancois »

coz I didnt find a solution, I decided to continue programming with windows-only commands (and replace them later)

so I decided to use the MouseButton() command, which requires OpenWindowedScreen()

Code: Select all

OpenWindow(0,#window_x,#window_y,#window_width,#window_height,0,"poolgame")
OpenWindowedScreen(WindowID(),0,0,GetDeviceCaps_(hdc,DESKTOPHORZRES),GetDeviceCaps_(hdc,DESKTOPVERTRES),0,0,0)
When the debugger reaches the ExamineMouse() command, it gives an error: ' OpenScreen() or OpenWindowedScreen() must be called before use mouse commands '. But it has been called... Or isnt it active :?:

Just to let u know: This is the code where I draw the bitmap to the window (its for a pool game). (this code is placed in a loop, and only called on specific occasions)

Code: Select all

StartDrawing(WindowOutput())
    DrawImage(ImageID(),(#window_width-#table_width)/2,(#window_height-#table_height)/2)
StopDrawing()
bernardfrancois
User
User
Posts: 47
Joined: Tue Sep 02, 2003 9:17 am
Location: Belgium
Contact:

Post by bernardfrancois »

I still didnt find a solution, and because I wanted to continue programming, I temporarily used the returnkey instead of the mouse button using the AddKeyboardShortcut() command...

Is there realy noone who ever used mouse commands in the linux version of purebasic? :?
Post Reply