How to separate the keys taken from textBox1.Text to be used as Modifier and a key for the RegisterHotKey?

28 Views Asked by At

How can I apply the keys inputed from the textbox here

I've been using RegisterHotkey() for a long time but I want it to be cuztomizable and the keys inputted in the Textbox to be applied in the RegisterHotkey so I can customize it in the app itself.

private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            m_hotkey = e.KeyData;
            textBox1.Text = new KeysConverter().ConvertToString(m_hotkey);
        }

to

private void RegisterHotKeys()
        {
            int id = 0;

            RegisterHotKey(this.Handle, id, (int)KeyModifier.Control, Keys.NumPad0.GetHashCode());
            id++;
        }

For example Ctrl + 0

m_hotkey = 0 while modiefier will = to control

0

There are 0 best solutions below