# Button Pressed
Grammar — Button Pressed
Flags —Native
|Function
Returns the button pressed. Use in response to a “Button Pressed” event.
Returns — string
<gamelink::Button>
native string EventButtonPressed();
# Supported triggers
- Button Pressed — TriggerAddEventButtonPressed
# 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/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:7000
}
if ((EventButtonPressed() == "TerranBuild")) {
if ((gv_terranMakeSupplyBuildMenuPressed == false)) {
gv_terranMakeSupplyBuildMenuPressed = true;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:7015
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_terranMakeSupplyBuildMenuPressed == true)) {
gv_terranMakeSupplyBuildMenuPressed = false;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:8137
}
if ((EventButtonPressed() == "TerranBuild")) {
if ((gv_terranMakeBarracksBuildMenuPressed == false)) {
gv_terranMakeBarracksBuildMenuPressed = true;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:8152
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_terranMakeBarracksBuildMenuPressed == true)) {
gv_terranMakeBarracksBuildMenuPressed = false;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:11244
}
if ((EventButtonPressed() == "ZergBuild")) {
if ((gv_zergMakeSpawningPoolBuildMenuPressed == false)) {
gv_zergMakeSpawningPoolBuildMenuPressed = true;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:11259
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_zergMakeSpawningPoolBuildMenuPressed == true)) {
gv_zergMakeSpawningPoolBuildMenuPressed = false;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:12438
}
if ((EventButtonPressed() == "ZergBuild")) {
if ((gv_zergMakeExtractorBuildMenuPressed == false)) {
gv_zergMakeExtractorBuildMenuPressed = true;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:12453
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_zergMakeExtractorBuildMenuPressed == true)) {
gv_zergMakeExtractorBuildMenuPressed = false;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:13426
}
if ((EventButtonPressed() == "ZergBuild")) {
if ((gv_zergMakeRoachWarrenBuildMenuPressed == false)) {
gv_zergMakeRoachWarrenBuildMenuPressed = true;
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:13441
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_zergMakeRoachWarrenBuildMenuPressed == true)) {
gv_zergMakeRoachWarrenBuildMenuPressed = false;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:7000
}
if ((EventButtonPressed() == "TerranBuild")) {
if ((gv_terranMakeSupplyBuildMenuPressed == false)) {
gv_terranMakeSupplyBuildMenuPressed = true;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:7015
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_terranMakeSupplyBuildMenuPressed == true)) {
gv_terranMakeSupplyBuildMenuPressed = false;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:8137
}
if ((EventButtonPressed() == "TerranBuild")) {
if ((gv_terranMakeBarracksBuildMenuPressed == false)) {
gv_terranMakeBarracksBuildMenuPressed = true;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:8152
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_terranMakeBarracksBuildMenuPressed == true)) {
gv_terranMakeBarracksBuildMenuPressed = false;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:11244
}
if ((EventButtonPressed() == "ZergBuild")) {
if ((gv_zergMakeSpawningPoolBuildMenuPressed == false)) {
gv_zergMakeSpawningPoolBuildMenuPressed = true;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:11259
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_zergMakeSpawningPoolBuildMenuPressed == true)) {
gv_zergMakeSpawningPoolBuildMenuPressed = false;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:12438
}
if ((EventButtonPressed() == "ZergBuild")) {
if ((gv_zergMakeExtractorBuildMenuPressed == false)) {
gv_zergMakeExtractorBuildMenuPressed = true;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:12453
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_zergMakeExtractorBuildMenuPressed == true)) {
gv_zergMakeExtractorBuildMenuPressed = false;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:13426
}
if ((EventButtonPressed() == "ZergBuild")) {
if ((gv_zergMakeRoachWarrenBuildMenuPressed == false)) {
gv_zergMakeRoachWarrenBuildMenuPressed = true;
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2map — MapScript.galaxy:13441
else {
}
if ((EventButtonPressed() == "Cancel")) {
if ((gv_zergMakeRoachWarrenBuildMenuPressed == true)) {
gv_zergMakeRoachWarrenBuildMenuPressed = false;