User Tools

Site Tools


en:examples:input:mouse_input

Using Mouse Inputs

Code

orxSTATUS orxFASTCALL Init()
{
  orxClock_Register(orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE), Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);
...

void orxFASTCALL Update(const orxCLOCK_INFO *_pstClockInfo, void *_pContext)
{
	if (orxInput_IsActive("MouseWheelUp") == orxTRUE){
		orxLOG("MouseWheelUp");
	}
 
	if (orxInput_IsActive("MouseWheelDown") == orxTRUE){
		orxLOG("MouseWheelDown");
	}
 
	if (orxInput_IsActive("LeftClick") == orxTRUE){
		orxLOG("LeftClick");
	}
 
	if (orxInput_IsActive("MiddleClick") == orxTRUE){
		orxLOG("MiddleClick");
	}
}
...

Config

[KeysForInput]
KEY_ESCAPE       = Quit
MOUSE_LEFT	 = LeftClick
MOUSE_MIDDLE	 = MiddleClick
MOUSE_WHEEL_UP	 = MouseWheelUp
MOUSE_WHEEL_DOWN = MouseWheelDown

en/examples/input/mouse_input.txt · Last modified: 2018/02/14 08:47 (2 years ago) (external edit)