Interface GuiEventListener
- All Superinterfaces:
TabOrderedElement
- All Known Subinterfaces:
ContainerEventHandler
- All Known Implementing Classes:
AbstractButton,AbstractCommandBlockEditScreen,AbstractContainerEventHandler,AbstractContainerScreen,AbstractContainerWidget,AbstractFurnaceScreen,AbstractOptionSliderButton,AbstractRecipeBookScreen,AbstractReportScreen,AbstractReportScreen.DiscardReportWarningScreen,AbstractScrollArea,AbstractSelectionList,AbstractSelectionList.Entry,AbstractSignEditScreen,AbstractSliderButton,AbstractStringWidget,AbstractTextAreaWidget,AbstractWidget,AccessibilityOnboardingScreen,AccessibilityOptionsScreen,AddRealmPopupScreen,AdvancementsScreen,AlertScreen,AnvilScreen,BackupConfirmScreen,BeaconScreen,BeaconScreen.BeaconCancelButton,BeaconScreen.BeaconConfirmButton,BeaconScreen.BeaconPowerButton,BeaconScreen.BeaconScreenButton,BeaconScreen.BeaconSpriteScreenButton,BeaconScreen.BeaconUpgradePowerButton,BlastFurnaceScreen,BookEditScreen,BookSignScreen,BookViewScreen,BrewingStandScreen,Button,ButtonListDialogScreen,CartographyTableScreen,ChatOptionsScreen,ChatReportScreen,ChatScreen,ChatSelectionScreen,ChatSelectionScreen.ChatSelectionList,ChatSelectionScreen.ChatSelectionList.DividerEntry,ChatSelectionScreen.ChatSelectionList.Entry,ChatSelectionScreen.ChatSelectionList.MessageEntry,ChatSelectionScreen.ChatSelectionList.MessageHeadingEntry,ChatSelectionScreen.ChatSelectionList.PaddingEntry,Checkbox,ClientCommonPacketListenerImpl.PackConfirmScreen,CommandBlockEditScreen,ConfigurationScreen,ConfigurationScreen.ConfigurationListScreen,ConfigurationScreen.ConfigurationListScreen.ListLabelWidget,ConfigurationScreen.ConfigurationSectionScreen,ConfigurationScreen.TooltipConfirmScreen,ConfirmExperimentalFeaturesScreen,ConfirmExperimentalFeaturesScreen.DetailsScreen,ConfirmExperimentalFeaturesScreen.DetailsScreen.PackList,ConfirmExperimentalFeaturesScreen.DetailsScreen.PackListEntry,ConfirmLinkScreen,ConfirmScreen,ConnectScreen,ContainerObjectSelectionList,ContainerObjectSelectionList.Entry,ContainerScreen,ControlsScreen,CrafterScreen,CraftingRecipeBookComponent,CraftingScreen,CreateBuffetWorldScreen,CreateBuffetWorldScreen.BiomeList,CreateBuffetWorldScreen.BiomeList.Entry,CreateFlatWorldScreen,CreateFlatWorldScreen.DetailsList,CreateFlatWorldScreen.DetailsList.Entry,CreateWorldScreen,CreativeModeInventoryScreen,CreditsAndAttributionScreen,CycleButton,DatapackLoadFailureScreen,DeathScreen,DeathScreen.TitleConfirmScreen,DemoIntroScreen,DialogListDialogScreen,DialogScreen,DialogScreen.WarningScreen,DirectJoinServerScreen,DisconnectedScreen,DispenserScreen,EditBox,EditGameRulesScreen,EditGameRulesScreen.BooleanRuleEntry,EditGameRulesScreen.CategoryRuleEntry,EditGameRulesScreen.GameRuleEntry,EditGameRulesScreen.IntegerRuleEntry,EditGameRulesScreen.RuleEntry,EditGameRulesScreen.RuleList,EditServerScreen,EditWorldScreen,EnchantmentScreen,ErrorScreen,ExperimentsScreen,ExtendedButton,ExtendedSlider,FittingMultiLineTextWidget,FocusableTextWidget,FontOptionsScreen,FurnaceRecipeBookComponent,FurnaceScreen,GameModeSwitcherScreen,GameModeSwitcherScreen.GameModeSlot,GenericMessageScreen,GenericWaitingScreen,GrindstoneScreen,HangingSignEditScreen,HopperScreen,HorseInventoryScreen,ImageButton,ImageWidget,ImageWidget.Sprite,ImageWidget.Texture,InBedChatScreen,InputControlHandlers.NumberRangeHandler.SliderImpl,InventoryScreen,ItemCombinerScreen,ItemDisplayWidget,JigsawBlockEditScreen,JoinMultiplayerScreen,KeyBindsList,KeyBindsList.CategoryEntry,KeyBindsList.Entry,KeyBindsList.KeyEntry,KeyBindsScreen,LanguageSelectScreen,LanguageSelectScreen.LanguageSelectionList,LanguageSelectScreen.LanguageSelectionList.Entry,LecternScreen,LevelLoadingScreen,LoadingDotsWidget,LoadingErrorScreen,LoadingErrorScreen.LoadingEntryList,LoadingErrorScreen.LoadingEntryList.LoadingMessageEntry,LockIconButton,LoomScreen,MerchantScreen,MerchantScreen.TradeOfferButton,MinecartCommandBlockEditScreen,ModListScreen,ModListScreen.InfoPanel,ModListWidget,ModListWidget.ModEntry,ModMismatchDisconnectedScreen,ModMismatchDisconnectedScreen.MismatchInfoPanel,ModsButton,MouseSettingsScreen,MultiButtonDialogScreen,MultiLineEditBox,MultiLineTextWidget,NameReportScreen,NoticeWithLinkScreen,ObjectSelectionList,ObjectSelectionList.Entry,OnlineOptionsScreen,OptimizeWorldScreen,OptionInstance.OptionInstanceSliderButton,OptionsList,OptionsList.Entry,OptionsList.OptionEntry,OptionsScreen,OptionsSubScreen,OutOfMemoryScreen,OverlayRecipeComponent,OverlayRecipeComponent.OverlayCraftingRecipeButton,OverlayRecipeComponent.OverlayRecipeButton,OverlayRecipeComponent.OverlaySmeltingRecipeButton,PackSelectionScreen,PageButton,PauseScreen,PauseScreen.FeedbackSubScreen,PlainTextButton,PlayerEntry,PlayerSkinWidget,PopupScreen,PresetFlatWorldScreen,PresetFlatWorldScreen.PresetsList,PresetFlatWorldScreen.PresetsList.Entry,ProgressScreen,RealmsBackupInfoScreen,RealmsBackupInfoScreen.BackupInfoList,RealmsBackupInfoScreen.BackupInfoListEntry,RealmsBackupScreen,RealmsBackupScreen.BackupObjectSelectionList,RealmsBackupScreen.Entry,RealmsBrokenWorldScreen,RealmsClientOutdatedScreen,RealmsConfigureWorldScreen,RealmsConfirmScreen,RealmsCreateRealmScreen,RealmsDownloadLatestWorldScreen,RealmsGenericErrorScreen,RealmsInviteScreen,RealmsLongRunningMcoConnectTaskScreen,RealmsLongRunningMcoTaskScreen,RealmsMainScreen,RealmsMainScreen.AvailableSnapshotEntry,RealmsMainScreen.ButtonEntry,RealmsMainScreen.CrossButton,RealmsMainScreen.EmptyEntry,RealmsMainScreen.Entry,RealmsMainScreen.NotificationButton,RealmsMainScreen.NotificationMessageEntry,RealmsMainScreen.ParentEntry,RealmsMainScreen.RealmSelectionList,RealmsMainScreen.ServerEntry,RealmsNotificationsScreen,RealmsParentalConsentScreen,RealmsPendingInvitesScreen,RealmsPendingInvitesScreen.Entry,RealmsPendingInvitesScreen.PendingInvitationSelectionList,RealmsPlayersTab.Entry,RealmsPlayersTab.InvitedObjectSelectionList,RealmsPreferredRegionSelectionScreen,RealmsPreferredRegionSelectionScreen.RegionSelectionList,RealmsPreferredRegionSelectionScreen.RegionSelectionList.Entry,RealmsResetWorldScreen,RealmsResetWorldScreen.FrameButton,RealmsScreen,RealmsSelectFileToUploadScreen,RealmsSelectFileToUploadScreen.Entry,RealmsSelectFileToUploadScreen.WorldSelectionList,RealmsSelectWorldTemplateScreen,RealmsSelectWorldTemplateScreen.Entry,RealmsSelectWorldTemplateScreen.WorldTemplateList,RealmsSlotOptionsScreen,RealmsSlotOptionsScreen.SettingsSlider,RealmsTermsScreen,RealmsUploadScreen,RealmsWorldSlotButton,ReceivingLevelScreen,RecipeBookComponent,RecipeBookTabButton,RecipeButton,RecoverWorldDataScreen,ReportPlayerScreen,ReportReasonSelectionScreen,ReportReasonSelectionScreen.ReasonSelectionList,ReportReasonSelectionScreen.ReasonSelectionList.Entry,SafetyScreen,Screen,ScrollableLayout.Container,ScrollPanel,SelectWorldScreen,ServerLinksDialogScreen,ServerReconfigScreen,ServerSelectionList,ServerSelectionList.Entry,ServerSelectionList.LANHeader,ServerSelectionList.NetworkServerEntry,ServerSelectionList.OnlineServerEntry,ShareToLanScreen,ShulkerBoxScreen,SignEditScreen,SimpleDialogScreen,SkinCustomizationScreen,SkinReportScreen,SmithingScreen,SmokerScreen,SocialInteractionsPlayerList,SocialInteractionsScreen,SoundOptionsScreen,SpriteIconButton,SpriteIconButton.CenteredIcon,SpriteIconButton.TextAndIcon,StateSwitchingButton,StatsScreen,StatsScreen.GeneralStatisticsList,StatsScreen.GeneralStatisticsList.Entry,StatsScreen.ItemStatisticsList,StatsScreen.ItemStatisticsList.ItemRow,StatsScreen.MobsStatisticsList,StatsScreen.MobsStatisticsList.MobRow,StonecutterScreen,StringWidget,StructureBlockEditScreen,TabButton,TabNavigationBar,TelemetryEventWidget,TelemetryInfoScreen,TestBlockEditScreen,TestInstanceBlockEditScreen,TitleScreen,TransferableSelectionList,TransferableSelectionList.PackEntry,UnicodeGlyphButton,UnsupportedGraphicsWarningScreen,VideoSettingsScreen,WaitingForResponseScreen,WarningScreen,WinScreen,WorldSelectionList,WorldSelectionList.Entry,WorldSelectionList.LoadingHeader,WorldSelectionList.WorldListEntry
Represents a listener for GUI events.
It extends the TabOrderedElement interface, providing tab order functionality for GUI components.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancharTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.default ScreenRectanglegetBorderForArrowNavigation(ScreenDirection direction) default ComponentPathdefault ScreenRectanglebooleandefault booleanisMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.default booleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.default booleankeyReleased(int keyCode, int scanCode, int modifiers) Called when a keyboard key is released within the GUI element.default booleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.default booleanmouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is dragged within the GUI element.default voidmouseMoved(double mouseX, double mouseY) Called when the mouse is moved within the GUI element.default booleanmouseReleased(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.default booleanmouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY) default ComponentPathRetrieves the next focus path based on the given focus navigation event.voidsetFocused(boolean focused) Sets the focus state of the GUI element.Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
DOUBLE_CLICK_THRESHOLD_MS
static final long DOUBLE_CLICK_THRESHOLD_MS- See Also:
-
-
Method Details
-
mouseMoved
default void mouseMoved(double mouseX, double mouseY) Called when the mouse is moved within the GUI element.- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.
-
mouseClicked
default boolean mouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseReleased
default boolean mouseReleased(double mouseX, double mouseY, int button) Called when a mouse button is released within the GUI element.- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was released.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseDragged
default boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is dragged within the GUI element.- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that is being dragged.dragX- the X distance of the drag.dragY- the Y distance of the drag.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseScrolled
default boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY) -
keyPressed
default boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Parameters:
keyCode- the key code of the pressed key.scanCode- the scan code of the pressed key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
keyReleased
default boolean keyReleased(int keyCode, int scanCode, int modifiers) Called when a keyboard key is released within the GUI element.- Parameters:
keyCode- the key code of the released key.scanCode- the scan code of the released key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
charTyped
default boolean charTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.- Parameters:
codePoint- the code point of the typed character.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
isMouseOver
default boolean isMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.- Returns:
trueif the mouse is over the GUI element,falseotherwise.
-
setFocused
void setFocused(boolean focused) Sets the focus state of the GUI element.- Parameters:
focused-trueto apply focus,falseto remove focus
-
isFocused
boolean isFocused() -
getCurrentFocusPath
-
getRectangle
-