[Mono-osx] Control and Mac key

Matt Emson memsom at interalpha.co.uk
Tue Mar 24 05:52:05 EDT 2009


Borja Ruiz Arroyo wrote:
> Thanks Matt,
>
> I can not change the keyboard setting, because I can't force all the 
> users to change it.

Well, no - that wouldn't work. I was just saying, remapping is possible 
globally - I wasn't clear if you are using an Apple keyboard or a 
Windows one.

> As I have seen when I tried (using X11) the mac (apple) key haven't 
> got the windows ctrl key behavior as it should.
X11 isn't Mac OS X, it's a layer on top. You might find that this is the 
issue?

> I have custom controls which have functionality with ctrl key. In 
> order to know if this key is pressed I use Control.ModifierKeys or 
> KeyEventArgs.Control, but in Mac i have to check mac key instead of 
> control key but it doesn't exist. How can i do that?
I assume you are using WinForms - I don't have much experience with 
WinForms under Mono. I've avoided it as it isn't portable enough to make 
all the shortfalls worthwhile.

> I can save the status of the mac key when pressed (key down)and update 
> it when released (key up), and use this status like I was using 
> ModifierKeys when the application is running in a Mac OS. But i was 
> looking for an easy way to do that, how can i do?
I'm not really sure what you want or mean here. Can you give more of a 
(code) example? Of how it "works" and how it also "fails"? I'm not sure 
if you are now saying that the key is detected correctly in the KeyXxx 
events, or that you are using some kind of work around? It sounds more 
like a bug in Mono if two different API calls/functions in the .Net 
framework give different values for the same key press event.

M



More information about the Mono-osx mailing list