Command + shift + @ or command + shift + 1


#1

Hi,
I’m creating shortcuts to activate fullscreen windows on the available displays on the users machine.
If they press command + shift + 1, they get a fullscreen window on the primary, 2 on the secondary etc.

However the code for OSX and Windows is different at this point, and i would like to fix it. On Windows i can use 1,2,3,4 as keys, and they will show up nicely in the menu as ‘ctrl + shift + 1’ etc.
On OSX when i use the same code i see the shortcuts displayed nicely like this:
[attachment=0]menu_osx_ok.png[/attachment]
But the shortcuts don’t work.

But if i use the ‘!’,’@’ keys the shortcuts do work (and that’s how have been using it for the last years) but they show up like this.
[attachment=1]menu_osx_wrong.png[/attachment]
Which i don’t like. Notice b.t.w that you don’t see the ‘!’ shortcut but that it does work :wink:

		for (int i=0; i<DisplayOutputDevice::getNumDevices(); ++i)
		{
			
			//set up keypress for first 8 displays
#ifdef JUCE_MAC
			const char characters[8] = {'!','@','#','$','%','^','&','*'};	
#else
			const char characters[8] = {'1','2','3','4','5','6','7','8'};
#endif
			if (i < 8)
			{
				KeyPress keyPress(characters[i], ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0);
				Menu::registerKeyPressForChoice(outputFullscreen.get(), i, keyPress);
			}
			
		}

#2

Not sure what’s going on there, but it’s certainly not safe to assume that those symbols are always on those number keys, because it’ll be different on lots of international keyboard layouts! (e.g. my british keyboard has £ above the 3, not #)


#3

Yes i know, but that is the only way i can get those shortcuts to work on OSX. I think it’s an issue of double translation, meaning that the mac menu key combo is not compatible with the commandmanager.