Garry's Mod Wiki

DTextEntry:OnEnter

  DTextEntry:OnEnter( string value )

Description

Called whenever enter is pressed on a DTextEntry.

DTextEntry:IsEditing will still return true in this callback!

Arguments

1 string value
The current text of the DTextEntry

Example

local TextEntry = vgui.Create( "DTextEntry" ) TextEntry:SetTextColor( Color( 255, 0, 0, 255 ) ) TextEntry.OnEnter = function() TextEntry:SetTextColor( Color( 0, 0, 255, 255 ) ) end
Output: Changes the text color when enter is pressed.