{"name":"displayRemoveEventHandler","title":"displayRemoveEventHandler","type":"command","url":"https://community.bistudio.com/wiki/displayRemoveEventHandler","revid":379335,"updated":"2026-10-30T23:52:50Z","groups":["GUI Control - Event Handlers","Event Handlers"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Remove a given event handler from the given display.","syntaxes":[{"syntax":"display displayRemoveEventHandler [handlerType, id]","params":[{"name":"display","type":"Display","type_expr":"Display"},{"name":"handlerType","type":"String","description":"type of the event handler","type_expr":"String"},{"name":"id","type":"Number","description":"index of the event handler","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"display"},"right":{"text":"[handlerType, id]"}}],"examples":[{"code":["findDisplay 46 displayRemoveEventHandler [\"keyDown\",5];"]}],"see_also":["disableSerialization","Display","displayAddEventHandler","displayRemoveAllEventHandlers"],"notes":[{"user":"Nelis75733126","date":"2015-04-19T21:25:00Z","text":"If you for example used this code to add the eventHandler:\n\n```sqf\n_myEH = findDisplay 46 displayAddEventHandler [\"KeyDown\", \"hint str _this\"];\n```\n\nThen later in that same script you can use the `_myEH` private variable to remove that same eventHandler again:\n\n```sqf\nfindDisplay 46 displayRemoveEventHandler [\"KeyDown\", _myEH];\n```\n\n( if obviously that private variable is known to the script environment you are referencing `_myEH` in )"}]}