Core Function RealGetKeyState

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> RealGetKeyState( <vk_keycode> ) </pre> === Description === Checks if a key is pressed down. === Parameters === ==== vk_keycode ==== A virtual key code (See [[Macros|Ma...")
 
(Example)
Line 31: Line 31:
 
println("B is pressed");
 
println("B is pressed");
 
}
 
}
 +
 +
 
if( RealGetKeyState(@KeyC) )
 
if( RealGetKeyState(@KeyC) )
 
{
 
{
 
println("C is pressed");
 
println("C is pressed");
 
}
 
}
 +
 +
 
if( RealGetKeyState(@KeyShiftKey) &&
 
if( RealGetKeyState(@KeyShiftKey) &&
 
RealGetKeyState(@KeyA)
 
RealGetKeyState(@KeyA)
Line 41: Line 45:
 
println("Shift+A is pressed");
 
println("Shift+A is pressed");
 
}
 
}
 +
 +
 
if( RealGetKeyState(@KeyShiftKey) &&
 
if( RealGetKeyState(@KeyShiftKey) &&
 
RealGetKeyState(@KeyControlKey) &&
 
RealGetKeyState(@KeyControlKey) &&
Line 48: Line 54:
 
println("Shift+Control+D is pressed");
 
println("Shift+Control+D is pressed");
 
}
 
}
 +
 +
 
if( RealGetKeyState(@KeyShiftKey) &&
 
if( RealGetKeyState(@KeyShiftKey) &&
 
RealGetKeyState(@KeyControlKey) &&
 
RealGetKeyState(@KeyControlKey) &&
Line 56: Line 64:
 
println("Shift+Control+Alt+E is pressed");
 
println("Shift+Control+Alt+E is pressed");
 
}
 
}
 +
 +
 
sleep(100);
 
sleep(100);
 
}
 
}

Revision as of 08:45, 27 April 2012

RealGetKeyState( <vk_keycode> )

Contents

Description

Checks if a key is pressed down.

Parameters

vk_keycode

A virtual key code (See Macros).

Return Value

None

Remarks

None.

Example

println("Try pressing B or C or Shift+A or Shift+Control+D or Shift+Control+Alt+E");
while(true)
{
	if( RealGetKeyState(@KeyB) )
	{
		println("B is pressed");
	}
 
 
	if( RealGetKeyState(@KeyC) )
	{
		println("C is pressed");
	}
 
 
	if( 	RealGetKeyState(@KeyShiftKey) &&
		RealGetKeyState(@KeyA)
		)
	{
		println("Shift+A is pressed");
	}
 
 
	if( 	RealGetKeyState(@KeyShiftKey) &&
		RealGetKeyState(@KeyControlKey) &&
		RealGetKeyState(@KeyD)
		)
	{
		println("Shift+Control+D is pressed");
	}
 
 
	if( 	RealGetKeyState(@KeyShiftKey) &&
		RealGetKeyState(@KeyControlKey) &&
		RealGetKeyState(@KeyMenu) &&
		RealGetKeyState(@KeyE)
		)
	{
		println("Shift+Control+Alt+E is pressed");
	}
 
 
	sleep(100);
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox