Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,876
    My Mood
    Psychedelic
    Before I respond....look at this meme.
    It describes my face atm.



    Now:

    Quote Originally Posted by Lovroman View Post
    Code:
    if(GetAsyncKeyState(VK_CONTROL) & GetAsyncKeyState(VK_ENTER) & 0x8000) 
    {
    
    }

    Code:
    if((GetAsyncKeyState(VK_XXX)&8000) && (GetAsyncKeyState(VK_YYY)&8000)) //If you're planning on holding both simultaneously for 8 seconds.
    {
    
    }
    You don't add the & 8000 unless you're planning to hold the second key down for 8 seconds for it to execute once.
    Quote Originally Posted by Lovroman View Post
    0x8000 is always same.


    GetAsyncKeyState(KeyCode) returns an unsigned integer in milliseconds of how long ago the key specified was LAST pressed. The "&" code performs a bitwise AND operation with the return value. Basically it's used to say "If XXX Is Pressed For X Milliseconds"

    You should never use "& 8000" as execution time will wait till it's held down for 8 seconds. (I generally used &1 for 1 millisecond.)

    Also, pointing out "&&" and "&" have different meanings.

    & -> Bitwise Operator AND
    && -> Conditional Operator AND

    Quote Originally Posted by BCxSocial(B) View Post
    ok That's the Value and its Wrong -_- Value of VK_UP is 0x26


    Quote Originally Posted by Lovroman View Post
    "Is key is pressed".
    inb4readabove
    Last edited by Kenshin13; 09-03-2013 at 02:05 AM.

  2. #17
    BCxSocial(B)'s Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    27
    Reputation
    10
    Thanks
    3
    My Mood
    Sad
    Quote Originally Posted by Kenshin13 View Post
    Before I respond....look at this meme.
    It describes my face atm.



    Now:




    Code:
    if((GetAsyncKeyState(VK_XXX)&8000) && (GetAsyncKeyState(VK_YYY)&8000)) //If you're planning on holding both simultaneously for 8 seconds.
    {
    
    }
    You don't add the & 8000 unless you're planning to hold the second key down for 8 seconds for it to execute once.




    GetAsyncKeyState(KeyCode) returns an unsigned integer in milliseconds of how long ago the key specified was LAST pressed. The "&" code performs a bitwise AND operation with the return value. Basically it's used to say "If XXX Is Pressed For X Milliseconds"

    You should never use "& 8000" as execution time will wait till it's held down for 8 seconds. (I generally used &1 for 1 millisecond.)

    Also, pointing out "&&" and "&" have different meanings.

    & -> Bitwise Operator AND
    && -> Conditional Operator AND







    inb4readabove
    Thanks!!!!!!!!!!!!!!!!!!!!!!!!

  3. #18
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,940
    Reputation
    574
    Thanks
    5,004
    My Mood
    Twisted
    Quote Originally Posted by Kenshin13 View Post
    inb4readabove
    Or just do it the way I do
    If (AsyncKeyState(Keys.F8))
    {
    //Do something
    }
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  4. #19
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,876
    My Mood
    Psychedelic
    Quote Originally Posted by Horror View Post

    Or just do it the way I do
    If (AsyncKeyState(Keys.F8))
    {
    //Do something
    }
    Hmm, not C# here we're talking about.
    But anyways, sometimes GetAsyncKeyState returns a high value (Sometimes negative) so I prefer to use bitwise comparisons to be safe.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Help] Map a button to a functional key [F1, F2, F3 ....etc] {Visual Basic}
    By odaysawaqed in forum Call of Duty Black Ops 2 Coding, Programming & Source Code
    Replies: 3
    Last Post: 07-25-2013, 06:37 PM
  2. [Request] Request to use " Function Keys " for casting / using skills.
    By kroem in forum Dragon Nest Discussions
    Replies: 8
    Last Post: 04-10-2013, 10:36 PM
  3. Replies: 3
    Last Post: 12-07-2012, 11:31 AM
  4. [WTS] Selling over 50+ Legit Arma 2 Operation Arrowhead CD KEYS ( I replace invalid etc)
    By iberdy in forum DayZ Selling / Trading / Buying
    Replies: 3
    Last Post: 12-03-2012, 03:20 PM
  5. function keys
    By lilcreeplil in forum WarRock Hack Source Code
    Replies: 3
    Last Post: 01-14-2011, 07:42 AM