Shortcut for showing hidden files in FileBrowserComponent


#1

Hi Jules,

What about adding this function in FileBrowserComponent:

bool FileBrowserComponent::keyPressed(const KeyPress &key) { if (key.getModifiers().isCommandDown() && key.getKeyCode() == 'H' || key.getKeyCode() == 'h') { fileList->setIgnoresHiddenFiles (!fileList->getIgnoresHiddenFiles()); fileList->refresh(); return true; } return false; }

That way the “ctrl-H” shortcut that is quite “standard” on Linux for toggling the display of hidden files works, and other OS get it for free also !

(I was really pleased to see that this functionality could be added with so few lines of code !)


#2

Good suggestion, though on the mac command+H hides the active app, so I think it’d need to be linux-only (or linux + windows)


#3

Right, I forgot this one. Maybe using isControlDown instead of isCommandDown is the simplest solution ?


#4

good spot !
also when you are at it, you might consider my changes for enabling the multi file selections in the FileBrowserComponent (plus using platform dialogs using zenity on linux when available):

http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?p=20355#20355

cheers