Hotkeys Tutorial by PSPiso
This is as simple as VB,
here is what u do make a Form Application;
add 3 timers and 2 labels;
name them like this:
label1 = label1
label2 = lStatusDisplay
timer1 = tHotkeyOn
timer2 = tHotkeyOff
timer3 = tStatusRapport
Add text to label1:
"Status:" "Place lStatusDisplay HERE!"
now double click on Form1
it will open form1.cs + it redirects to Form1_Load enter this code there:
then to the top and till you reach
and place this code above ....:
underneath it:
now that we have activated the getasynckeystate & added a bool.
we are ready to make a hotkeyactivator and deactivator(most coders can use the ! fuction too for a on and off for a function of 1 button.):
write underneath the #endregion from the above given code:
now that we are done with assigning hotkeys, we are gona add these to a timer so that these can be activated on the Form Add these codes when you have opened up all timers,add these codes:
and its done now press CTRL+F5 and see the results.
the hotkeys are numpad1 and numpad2.

here is what u do make a Form Application;
add 3 timers and 2 labels;
name them like this:
label1 = label1
label2 = lStatusDisplay
timer1 = tHotkeyOn
timer2 = tHotkeyOff
timer3 = tStatusRapport
Add text to label1:
"Status:" "Place lStatusDisplay HERE!"
now double click on Form1
it will open form1.cs + it redirects to Form1_Load enter this code there:
Code:
tStatRapport.Start(); tHotkeyOff.Start();
Code:
"public partial class Form1 : Form
{"
underneath it:
Code:
#region Imports And Includes
[DllImport("user32.dll")]
static extern Boolean GetAsyncKeyState(System.Windows.Forms.Keys vKey);
bool statusOnOrOff = false;
#endregion
we are ready to make a hotkeyactivator and deactivator(most coders can use the ! fuction too for a on and off for a function of 1 button.):
write underneath the #endregion from the above given code:
Code:
#region Commando's For Timers
public void hotkeyOnSwitch()
{
Boolean hotkey1;
hotkey1 = GetAsyncKeyState(Keys.NumPad1);
if(hotkey1 == true)
{
this.statusOnOrOff = true;
tHotkeyOn.Start();
tHotkeyOff.Stop();
}
}
public void hotkeyOffSwitch()
{
Boolean hotkey2;
hotkey2 = GetAsyncKeyState(Keys.NumPad2);
if(hotkey2 == true)
{
this.statusOnOrOff = false;
tHotkeyOn.Stop();
tHotkeyOff.Start();
}
}
#endregion
Code:
private void tHotkeyOn_Tick(object sender, EventArgs e)
{
hotkeyOffSwitch();
this.statusOnOrOff = true;
}
private void tHotkeyOff_Tick(object sender, EventArgs e)
{
hotkeyOnSwitch();
this.statusOnOrOff = false;
}
private void tStatusRapport_Tick(object sender, EventArgs e)
{
if (statusOnOrOff == true)
{
lStatusDisplay.Text = "On";
}
else if (statusOnOrOff == false)
{
lStatusDisplay.Text = "Off";
}
}
the hotkeys are numpad1 and numpad2.

