# Mouse Moved
Grammar — Player player moves mouse.
Flags —Native
|Event
Only register for this event when you absolutely need it, as it will generate network traffic from all players for every mouse move they make. This event fires when a player moves themouse. Use “Mouse Moved UI Pos X” and “Mouse Moved UI Pos Y” to get the UI X,Y position where the player moved the mouse. Use “Mouse Moved World Pos X”, “Mouse Moved World Pos Y”, and “Mouse Moved World Pos Z” to get the X,Y,Z world position where the player moved the mouse.
# Arguments
int
— Player
Returns — void
native void TriggerAddEventMouseMoved(
trigger t,
int player,
);
# Event parameters
- Triggering Game User — EventGameUser
- Triggering Player — EventPlayer
- Mouse Moved UI Pos X — EventMouseMovedPosXUI
- Mouse Moved UI Pos Y — EventMouseMovedPosYUI
- Mouse Moved World Pos X — EventMouseMovedPosXWorld
- Mouse Moved World Pos Y — EventMouseMovedPosYWorld
- Mouse Moved World Pos Z — EventMouseMovedPosZWorld
- Mouse Wheel Spin — EventMouseWheelSpin
# Related
Category: UI / Input
- Key Pressed —
void
— TriggerAddEventKeyPressed - Hotkey Pressed —
void
— TriggerAddEventHotkeyPressed - Button Pressed —
void
— TriggerAddEventButtonPressed - Mouse Clicked —
void
— TriggerAddEventMouseClicked - Mouse Moved —
void
— TriggerAddEventMouseMoved - Mouse Wheel —
void
— TriggerAddEventMouseWheel - Button Pressed —
string
<gamelink::Button> — EventButtonPressed - Key Pressed —
int
<preset::Key> — EventKeyPressed - Hotkey Pressed —
int
<preset::Key> — EventHotkeyPressed - Control Key Pressed —
bool
— EventKeyControl - Alt Key Pressed —
bool
— EventKeyAlt - Shift Key Pressed —
bool
— EventKeyShift - Mouse Clicked Button —
int
<preset::MouseButton> — EventMouseClickedButton - Mouse Clicked UI Pos X —
int
— EventMouseClickedPosXUI - Mouse Clicked UI Pos Y —
int
— EventMouseClickedPosYUI - Mouse Clicked World Pos X —
fixed
— EventMouseClickedPosXWorld - Mouse Clicked World Pos Y —
fixed
— EventMouseClickedPosYWorld - Mouse Clicked World Pos Z —
fixed
— EventMouseClickedPosZWorld - Mouse Moved UI Pos X —
int
— EventMouseMovedPosXUI - Mouse Moved UI Pos Y —
int
— EventMouseMovedPosYUI - Mouse Moved World Pos X —
fixed
— EventMouseMovedPosXWorld - Mouse Moved World Pos Y —
fixed
— EventMouseMovedPosYWorld - Mouse Moved World Pos Z —
fixed
— EventMouseMovedPosZWorld - Mouse Wheel Spin —
fixed
— EventMouseWheelSpin
# Examples
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:6595
libVCUI_gt_PU_ArmyRotateUnit = TriggerCreate("libVCUI_gt_PU_ArmyRotateUnit_Func");
TriggerEnable(libVCUI_gt_PU_ArmyRotateUnit, false);
TriggerAddEventMouseMoved(libVCUI_gt_PU_ArmyRotateUnit, c_playerAny);
}
mods/frontiers.sc2mod — base.sc2data/Lib6CB3363F.galaxy:1673
void lib6CB3363F_gt_MouseMoveUpdate_Init () {
lib6CB3363F_gt_MouseMoveUpdate = TriggerCreate("lib6CB3363F_gt_MouseMoveUpdate_Func");
TriggerAddEventMouseMoved(lib6CB3363F_gt_MouseMoveUpdate, c_playerAny);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:8029
libGDHL_gv_heroChenWanderingKegHealthStore[lv_player] = UnitGetPropertyFixed(lv_chen, c_unitPropLife, c_unitPropCurrent);
if ((libGDHL_gv_heroChenWanderingKegEventAdded[lv_player] == false)) {
TriggerAddEventMouseMoved(libGDHL_gt_HeroChenWanderingKegMoveTracker, EventPlayer());
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:23203
CatalogFieldValueSetFixed(c_gameCatalogUnit, "HeroTinker", "StationaryTurningRate", lv_player, libGDHL_gv_heroTinkerDethLazorMaxTurnRate);
if ((PlayerHasTalent(lv_player, "TinkerTalentFirinMahLazorz") == true)) {
TriggerAddEventMouseMoved(libGDHL_gt_HeroTinkerDethLazorAim, EventPlayer());
}
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:907
libHCHO_gv_surgingFistActiveFlag[UnitGetOwner(lv_cho)] = true;
libHCHO_gv_surgingFistActiveCasters = (libHCHO_gv_surgingFistActiveCasters + 1);
TriggerAddEventMouseMoved(libHCHO_gt_SurgingFistMouseTracker, EventPlayer());
TriggerEnable(libHCHO_gt_SurgingFistMouseTracker, true);
while ((UnitHasBehavior2(lv_cho, "ChoSurgingFistInitialFakeCast") == true)) {
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:1782
libHCHO_gf_HeroChogallGallFollow(libGDHL_gv_chogallPairs[lv_chogallTeam].lv_gallUnit);
UISetCommandAllowed(PlayerGroupSingle(lv_gallPlayer), c_uiCommandAllowQueue, false);
TriggerAddEventMouseMoved(libHCHO_gt_SurgingFistMouseTracker, lv_gallPlayer);
TriggerAddEventMouseClicked(libHCHO_gt_SurgingFistExecuteChargetomouse, lv_gallPlayer, c_mouseButtonLeft,true);
TriggerAddEventPlayerEffectUsed(libHCHO_gt_SurgingFistExecuteChargetomouse, lv_gallPlayer,"ChoSurgingFistTriggerDummyEffect");