Hi!
Just a quick thought, since I’ve done something similar once.
Create a bool for the CMD-button-state, and simply toggle it anytime you press/release command.
Then you check the bool when ‘f’ is pressed.
switch(key){
case OF_KEY_COMMAND:
bCommandPressed = true;
break;
case 'f':
if(bCommandPressed)
ofToggleFullscreen();
break;
}
Ah! Didn’t realize this is different than the basic keyPressed(int key) function.
I’ve tried it this way, and with std::cout << key.key << std::endl I saw it modified the value, when cmd is pressed. (f = 102, cmd+f = 6)
So another way could be
switch(key.key){
case 6:
ofToggleFullscreen();
break;
}
Assuming no other key-combinations result in 6… Cheers!
Maybe this is related, I assumed I had found a bug with modifier keys in the current release.
Putting this code in keypressed() prints both couts when I hit the command key. Something changed for sure.
keyPressed(int key){
if (key == OF_KEY_COMMAND) {
cout<<"got the command key" << endl;
}
if (key != OF_KEY_COMMAND) {
cout<<"got another key" << endl;
}
}