There is such code:
int Switch5 = ProcessMemoryReaderApi.GetKeyState(0xA1); if ((Switch5 & 0x8000) != 0) { act = !act; if (act) Console.WriteLine("true"); else Console.WriteLine("false"); } When you press the SHIFT key - the program comes here. But! If you hold it and not let go - the bool act quickly changes from false to true. How can you make it so that when you press shift, act true, even if you keep it constant? And when you click on shift again - the variable is changed to false