Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# getasynckeystate mouse

[DllImport("user32.dll")]
static extern short GetAsyncKeyState(int VirtualKeyPressed);
 
public static bool GetLeftMousePressed()
    {
        if (GetAsyncKeyState(0x01) == 0)
            return false;
        else
            return true;
    }

// 0x01 stands for left Mouse click
// for different Virtual-Keys view list:
// https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

Credit: Jason Wong on Stack Overflow
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to convert string to guid c# 
Csharp :: c# find start and end of month from object date 
Csharp :: c# math to radiant 
Csharp :: loop through an enum c# 
Csharp :: check if gameobject is active 
Csharp :: how to index ireadonlycollection c# 
Csharp :: csgo throw last grenade bind 
Csharp :: round to float unity 
Csharp :: c# get file size in bytes 
Csharp :: OnInitialized blazor 
Csharp :: movement script c# 
Csharp :: c# random enum 
Csharp :: unity how to copy something to the clipboard 
Csharp :: print out a dictionary c# 
Csharp :: enum loop 
Csharp :: c# executable directory 
Csharp :: smooth rotation unity 
Csharp :: c# random boolean 
Csharp :: c# list string initialize inline 
Csharp :: delete null elements array c# 
Csharp :: c# list object to json 
Csharp :: c# tostring mmm dd yyyy 
Csharp :: unity string array 
Csharp :: unity smooth camera 2d 
Csharp :: c# kill all processes by name 
Csharp :: how to spawn coins randomly around the screen unity 2d 
Csharp :: unity c# reference link url 
Csharp :: set ads for children admob unity 
Csharp :: shutdown system c# 
Csharp :: InvalidOperationException: Calling Scene Raisefrom assembly reloading callbacks are not supported. 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =