Hotkeys - ComboBox & Timer_Tick

Posts 1–10 of 10 · Page 1 of 1
Hotkeys - ComboBox & Timer_Tick
That is placed in my Hack.h

The part of ComboBox: (Just 2 of 8)
Code:
	private: System::Void comboBox4_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) { //GLOWKEY
		System::String^ CLRString = (String^)(comboBox4->SelectedItem);
		msclr::interop::marshal_context context;
		std::string STDString = context.marshal_as<std::string>(CLRString);
		for (int i = 0; i < sizeof(PossibleKeyText) / sizeof(PossibleKeyText[0]); i++)
		{
			if (PossibleKeyText[i] == STDString)
				glowKey = PossibleKeyDWORD[i];
		}
	}
	private: System::Void comboBox5_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) { //TEAMGLOWKEY
		System::String^ CLRString = (String^)(comboBox5->SelectedItem);
		msclr::interop::marshal_context context1;
		std::string STDString = context1.marshal_as<std::string>(CLRString);
		for (int i = 0; i < sizeof(PossibleKeyText) / sizeof(PossibleKeyText[0]); i++)
		{
			if (PossibleKeyText[i] == STDString)
				teamGlowKey = PossibleKeyDWORD[i];
		}
	}
Timer_Tick1:
Code:
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
		if (GetAsyncKeyState(glowKey) & 0x8000) { //GLOW
			while (GetAsyncKeyState(glowKey) & 0x8000) {
				Sleep(1);
			}
			glowToggle = !glowToggle;
			if (glowToggle) {
				checkBox3->Checked = true;
			}
			else {
				checkBox3->Checked = false;
			}
		}

		if (GetAsyncKeyState(teamGlowKey) & 0x8000) { //TEAMGLOW
			while (GetAsyncKeyState(teamGlowKey) & 0x8000) {
				Sleep(1);
			}
			teamesp = !teamesp;
			if (teamesp) {
				checkBox4->Checked = true;
			}
			else {
				checkBox4->Checked = false;
			}
		}
        }
I already tried alot of things, but only the 1 ComboBox sets the hotkey working, i tried changing the second (teamGlowKey) on timer_tick to 32 (spacebar) and it works, but when i use the teamGlowKey set by the ComboBox it don't work, and with that i got confuded...

Since i used WasserEsser (i think i wrote wrong) method of comboBox, i think he can help me

PS: Var names are horrible because i re-wrote in a new project really fast :/

Thx
Wait, can you please tell me what you want to do exactly? I don't get what you want to do.

- - - Updated - - -

So you want to toggle the checkboxes with keys?

- - - Updated - - -

Code:
while (GetAsyncKeyState(glowKey) & 0x8000) {
			Sleep(1);
		}
What is the point in this?
Quote Originally Posted by WasserEsser View Post
Wait, can you please tell me what you want to do exactly? I don't get what you want to do.

- - - Updated - - -

So you want to toggle the checkboxes with keys?

- - - Updated - - -

Code:
while (GetAsyncKeyState(glowKey) & 0x8000) {
			Sleep(1);
		}
What is the point in this?
Yep correct checkbox with keys, and the point of this while is because if you press the key it will spam, and with it, will stop the spam and only "record" 1 press, i changed the sleep to (500);
Quote Originally Posted by PhY'z View Post
the point of this while is because if you press the key it will spam, and with it, will stop the spam and only "record" 1 press, i changed the sleep to (500);
& 1

Profit??
Quote Originally Posted by WasserEsser View Post
& 1

Profit??
Stills nothing with the hotkeys, somehow it don't "set" the hotkey to the variable teamGlowKey
Quote Originally Posted by PhY'z View Post
Stills nothing with the hotkeys, somehow it don't "set" the hotkey to the variable teamGlowKey
Start to debug your code lol. And why do you use a different name for that context marshal thing, but not for CLRstring or stdstring
Quote Originally Posted by WasserEsser View Post
Start to debug your code lol. And why do you use a different name for that context marshal thing, but not for CLRstring or stdstring
I would do that if the console shows up, but it don't, tried in different projects too, it stills not open .-.
Quote Originally Posted by PhY'z View Post
I would do that if the console shows up, but it don't, tried in different projects too, it stills not open .-.
Why would you want to show up a console?
Quote Originally Posted by WasserEsser View Post
Why would you want to show up a console?
@Color Close (; Fixed by myself...

Explanation: Used more 2 timers, first to get the hotkeys loop, and the second to verify if the hotkey is pressed (; Only way that i found, the other method is bugged for me, anyway thnx @WasserEsser (;
//Solved...
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us