Control-key pressed / 2nd MouseKey on MacBook

BlitzMax Forums/MaxGUI Module/Control-key pressed / 2nd MouseKey on MacBook

explosive(Posted 2009) [#1]
Hello alltogether,

after a while coding with a 'complete' mouse, I just discovered, that all my menus that pop up when the secondary mousekey is hit don't work, because a MacBook doesn't have one. The equivalent to it is a mouseclick with the control-key pressed.

My question is now, how can I find out, if the control-key is pressed. For me it seems as if the control-key doesn't emit an event. Any idea?

Many thanks in advance
Simon


skidracer(Posted 2009) [#2]
eventmods should return the value 2 when ctrl is down,

printing the event stream is a useful way of finding out more information about events as the docs are so poor:

	WaitEvent 
	Print CurrentEvent.ToString()



explosive(Posted 2009) [#3]
Hi skidracer,

I had a try on your idea, but unfortunately, it still returns the value 1 in EventData(). But I definitely get an event when the control-button is pressed or released. I guess I have to write a function that checks these two events and saves the current button-state in a global variable. I just have to make sure, that the function is called in every loop I have in my programme.

Thanks indeed!
Simon


DrDeath(Posted 2009) [#4]
There is a difference how BlitzMax handles an actual right click (or two finger click on the trackpads of newer MacBooks) and a ctrl+click.

That's the output for a right click/two finger click:
MouseDown: data=2, mods=0, x=268, y=266, extra=""


And that's a ctrl+click:
MouseDown: data=1, mods=2, x=268, y=266, extra=""


To catch a ctrl+click, you unfortunately have to implement extra code that watches the modifiers of the mouse click event.