| | import picocli.CommandLine; |
| | import picocli.CommandLine.Command; |
| | +import picocli.CommandLine.Help.Ansi.Style; |
| | |
| | import javax.swing.*; |
 |
| | import static javax.swing.SwingUtilities.invokeLater; |
| | import static org.jnativehook.GlobalScreen.*; |
| | +import static picocli.CommandLine.Help.ColorScheme; |
| | import static picocli.CommandLine.Option; |
| | |
 |
| | @Option( |
| | names = {"-a", "--delay-alphanum"}, |
| | - description = "Delay for releasing non-modifier keys (${DEFAULT-VALUE} milliseconds)", |
| | + description = "Delay for releasing non-modifier keys (${DEFAULT-VALUE} " + |
| | + "milliseconds)", |
| | paramLabel = "delay", |
| | defaultValue = "250" |
 |
| | @Option( |
| | names = {"-m", "--delay-modifier"}, |
| | - description = "Delay for releasing modifier keys (${DEFAULT-VALUE} milliseconds)", |
| | + description = "Delay for releasing modifier keys (${DEFAULT-VALUE} " + |
| | + "milliseconds)", |
| | paramLabel = "delay", |
| | defaultValue = "150" |
 |
| | logger.setLevel( OFF ); |
| | logger.setUseParentHandlers( false ); |
| | + } |
| | + |
| | + private static ColorScheme createColourScheme() { |
| | + return new ColorScheme.Builder() |
| | + .commands( Style.bold ) |
| | + .options( Style.fg_blue, Style.bold ) |
| | + .parameters( Style.fg_blue ) |
| | + .optionParams( Style.italic ) |
| | + .errors( Style.fg_red, Style.bold ) |
| | + .stackTraces( Style.italic ) |
| | + .build(); |
| | } |
| | |
 |
| | Thread.yield(); |
| | } |
| | + |
| | + final var kc = new KmCaster(); |
| | + final var cli = new CommandLine( kc ); |
| | + cli.setColorScheme( createColourScheme() ); |
| | |
| | invokeLater( () -> { |
| | - final var kc = new KmCaster(); |
| | - final var cli = new CommandLine( kc ); |
| | final var exitCode = cli.execute( args ); |
| | final var parseResult = cli.getParseResult(); |