You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.3 KiB

5 years ago
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace NumpadMonitor
{
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string args0 = args.Length > 0 ? args[0] : "";
NumpadMonitorForm monitor = Initiate(args0 == "config-keys");
Application.Run(monitor);
}
public static NumpadMonitorForm Initiate(bool configKeys = false, bool alternativeKeyset = false, bool formVisible = true)
{
List<KeyInfo> keyinfo = KeyCodeReaderWriter.Read();
if (configKeys || keyinfo == null)
{
KeyConfig keyConfig = new KeyConfig(alternativeKeyset);
keyConfig.ShowDialog();
keyConfig.Dispose();
keyinfo = KeyCodeReaderWriter.Read();
}
NumpadMonitorForm monitor = new NumpadMonitorForm(keyinfo, alternativeKeyset, formVisible);
return monitor;
}
}
}