/*
 * Copyright (C) 2017 Satomichi Nishihara
 *
 * This file is distributed under the terms of the
 * GNU General Public License. See the file `LICENSE'
 * in the root directory of the present distribution,
 * or http://www.gnu.org/copyleft/gpl.txt .
 */

package burai.com.keys;

import javafx.scene.input.KeyCode;
import burai.com.env.Environments;

public final class KeyName {

    private KeyName() {
        // NOP
    }

    public static String getShortcut() {
        return getShortcut(null);
    }

    public static String getShortcut(KeyCode keyCode) {
        String comb = Environments.isMac() ? "Command" : "Ctrl";
        String name = keyCode == null ? null : keyCode.getName();
        if (name == null) {
            return comb;
        } else {
            return comb + "+" + name;
        }
    }

    public static String getShortcutShift() {
        return getShortcutShift(null);
    }

    public static String getShortcutShift(KeyCode keyCode) {
        String comb = Environments.isMac() ? "Command+Shift" : "Ctrl+Shift";
        String name = keyCode == null ? null : keyCode.getName();
        if (name == null) {
            return comb;
        } else {
            return comb + "+" + name;
        }
    }
}

@@ -1281,12 +1281,403 @@
 %0D%0A    %7D%0D
+%0A%0D%0A    public static String getAlt() %7B%0D%0A        return getAlt(null);%0D%0A    %7D%0D%0A%0D%0A    public static String getAlt(KeyCode keyCode) %7B%0D%0A        String comb = Environments.isMac() ? %22Option%22 : %22Alt%22;%0D%0A        String name = keyCode == null ? null : keyCode.getName();%0D%0A        if (name == null) %7B%0D%0A            return comb;%0D%0A        %7D else %7B%0D%0A            return comb + %22+%22 + name;%0D%0A        %7D%0D%0A    %7D%0D
 %0A%7D%0D%0A

add Alt to KeyName