User Tools

Site Tools


en:examples:input:mouse_input

Using Mouse Inputs

Code

orxSTATUS orxFASTCALL Init()
{
  orxClock_Register(orxClock_Get(orxCLOCK_KZ_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: 2022/12/06 13:40 (2 years ago) by iarwain