I want to use BindKey(true, AnyKey, 0,0)
But I do not know how to get AnyKey
help me. I apologize for the poor english
http://nehe.gamedev.net/article/msdn_virtualkey_codes/15009/
Quote from: KAKAN on Jul 07, 2017, 04:48 PMhttp://nehe.gamedev.net/article/msdn_virtualkey_codes/15009/
Thanks but my idea is like "press any key to continue"
there you go:
anykey <- array(100, false);
function onPlayerJoin( player ){
player.Msg( "Press any key to continue.");
anykey[ player.ID ] = true;
}
function onKeyDown( player, key ){
if( anykey[ player.ID ] ){
player.Msg( "YOU PRESSED 'ANY' KEY, SO SMD!" );
anykey[ player.ID ] = false; // or he'll keep getting the threatening messages.
}
FFS stop posting in wrong boards.
Quote from: Anik on Jul 08, 2017, 06:23 AMFFS stop posting in wrong boards.
Sorry for posting the wrong post but after finding the required function I will delete the post.
Is there any function similar to getch () in C ++?
Quote from: longhackmc on Jul 08, 2017, 06:38 AMQuote from: Anik on Jul 08, 2017, 06:23 AMFFS stop posting in wrong boards.
Sorry for posting the wrong post but after finding the required function I will delete the post.
Is there any function similar to getch () in C ++?
you wanted any key to continue. So, what, are you going to loop over all keys? I've provided a very easy example to follow, it's in squirrel. Look up. The topic's discussion ends here :)
I doubt that example will work. The onKeyDown event will probably (I didn't test) only be called for keys that were binded.
So no, unless you're going to bind to all keys (Which is a bad idea) this isn't possible.
Quote from: Thijn on Jul 09, 2017, 10:46 AMI doubt that example will work. The onKeyDown event will probably (I didn't test) only be called for keys that were binded.
My antivirus wouldn't mark VCMP as a "KeyLogger" if it did what you said so.
just founded this on google
worked for me
https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Events/KeyBind::OnUp
^ This is probably what you need.
Quote from: KAKAN on Jul 09, 2017, 12:14 PMQuote from: Thijn on Jul 09, 2017, 10:46 AMI doubt that example will work. The onKeyDown event will probably (I didn't test) only be called for keys that were binded.
My antivirus wouldn't mark VCMP as a "KeyLogger" if it did what you said so.
Of course it would. There's a difference between logging it and calling an event.
Quote from: Thijn on Jul 11, 2017, 05:08 PMQuote from: KAKAN on Jul 09, 2017, 12:14 PMQuote from: Thijn on Jul 09, 2017, 10:46 AMI doubt that example will work. The onKeyDown event will probably (I didn't test) only be called for keys that were binded.
My antivirus wouldn't mark VCMP as a "KeyLogger" if it did what you said so.
Of course it would. There's a difference between logging it and calling an event.
From my point of view, VCMP captures all the keybinds even if we have only one key to capture.
According to you, Discord(
push-to-talk ) should be marked as a KeyLogger as well, but it isn't.
https://en.wikipedia.org/wiki/Keystroke_logging
KeyLogger means something else than just binding a single key.
Quote from: KAKAN on Jul 11, 2017, 05:38 PMQuote from: Thijn on Jul 11, 2017, 05:08 PMQuote from: KAKAN on Jul 09, 2017, 12:14 PMQuote from: Thijn on Jul 09, 2017, 10:46 AMI doubt that example will work. The onKeyDown event will probably (I didn't test) only be called for keys that were binded.
My antivirus wouldn't mark VCMP as a "KeyLogger" if it did what you said so.
Of course it would. There's a difference between logging it and calling an event.
From my point of view, VCMP captures all the keybinds even if we have only one key to capture.
According to you, Discord( push-to-talk ) should be marked as a KeyLogger as well, but it isn't.
https://en.wikipedia.org/wiki/Keystroke_logging
KeyLogger means something else than just binding a single key.
Read my reply again. I'm not saying the client isn't listening for all keys, I'm saying the client will only send it's key statuses when it's binded to the server. Otherwise the bandwidth will be way too high.
There is no reason to use serverside keybinds since we have clientside one. So we can use bandwidth wisely.
Simple example:
vito_keys <- {
"as_array" : []
"by_id" : {},
"binds" : {}
};
vito_keys.as_array = [];
for(local i = 0; i < 300; i++){
vito_keys.as_array.push([i.tostring(), i]);
}
foreach(vito_key in ::vito_keys.as_array){
::vito_keys.by_id.rawset(vito_key[1], vito_key[0]);
};
foreach(vito_key in ::vito_keys.as_array){
::vito_keys.binds.rawset(vito_key[0],[KeyBind(vito_key[1]), vito_key[1], vito_key[0]]);
};
function KeyBind::OnDown(keybind) {
foreach(vito_keybind_key, vito_keybind in ::vito_keys.binds){
if(vito_keybind[0] == keybind){
::Console.Print("keydown key_id="+vito_keybind[1]+" key_name="+vito_keybind[2]);
}
}
}