added key accelerators

This commit is contained in:
Kelly Kelly 2020-06-01 15:06:13 -04:00
parent bd297c54da
commit bbbd5d87b5

View File

@ -82,6 +82,12 @@ public class CategorizeAction extends Action {
this.tagName = tagName; this.tagName = tagName;
setGraphic(getGraphic(tagName)); setGraphic(getGraphic(tagName));
setEventHandler(actionEvent -> addCatToFiles(selectedFileIDs)); setEventHandler(actionEvent -> addCatToFiles(selectedFileIDs));
int rank = tagName.getRank();
// Only map to a key if the rank is less than 10
if(rank < 10) {
setAccelerator(new KeyCodeCombination(KeyCode.getKeyCode(Integer.toString(rank))));
}
} }
static public Menu getCategoriesMenu(ImageGalleryController controller) { static public Menu getCategoriesMenu(ImageGalleryController controller) {