Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.14.2] Keyboard listener
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
Soup

[1.14.2] Keyboard listener

By Soup, June 25 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Soup    0

Soup

Soup    0

  • Tree Puncher
  • Soup
  • Members
  • 0
  • 3 posts
Posted June 25

Sorry if this is a beginner question but how would i go about getting if a key on the keyboard has been pressed, I have tried using InputEvent.KeyInputEvent but it fires both when you press the key and hold the key so it doesn't really work, and all the other key events seems to be for for GuiScreens, so if anybody could help me that would be great.

  • Quote

Share this post


Link to post
Share on other sites

Pyrosshade    0

Pyrosshade

Pyrosshade    0

  • Tree Puncher
  • Pyrosshade
  • Members
  • 0
  • 4 posts
Posted July 2

This is a General Java question.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6684

diesieben07

diesieben07    6684

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6684
  • 45695 posts
Posted July 2
1 hour ago, Pyrosshade said:

This is a General Java question.

It is not.

 

@Soup If you're still looking, you need a KeyBinding. InputEvent.KeyInputEvent provides lower-level access through LWJGL.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DaemonUmbra
      Failed to synchronize data from server.

      By DaemonUmbra · Posted 4 minutes ago

      Please don’t hijack other people’s threads, if you have an issue please make your own thread
    • DaemonUmbra
      Forge will not launch, crashes immediately

      By DaemonUmbra · Posted 5 minutes ago

      Please read the logs section of my signature below and provide the appropriate log in the appropriate manner.
    • solitone
      Distinguish singleplayer vs. multiplayer

      By solitone · Posted 24 minutes ago

      From what I see in the examples I've found, proxies are basically used for preInitialization, Inizialization, and postInizialization tasks.    Here I've got an Item class, with method onItemRightClick() that should perform different things based on the game mode (multiplayer vs. singleplayer).   How would I take advantage of the sided proxies to refactor the following class? Should I have two classes, one for the client, the other for the dedicated server, and register the first class on the client, and the second on the dedicated server?   I'm confused and basically stuck.   public class ScriptItem extends Item { // [...] @Override public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) { // [...] String separator = getSeparator(); if (world.isRemote) { // client side if (!Minecraft.getMinecraft().isSingleplayer()) { // client talks to dedicated server (multiplayer game) String scriptName = nbtTagCompound.getString("scriptName"); ClientCommandHandler.instance.executeCommand(player, "/lpython " + "pythontool" + separator + scriptName); } } else { // server side if (!FMLCommonHandler.instance().getMinecraftServerInstance().isDedicatedServer()) { // server is integrated (singleplayer game) String scriptName = nbtTagCompound.getString("scriptName"); world.getMinecraftServer().getCommandManager().executeCommand(player, "/python " + "pythontool" + separator + scriptName); } } }  
    • SeekingTanis
      Forge will not launch, crashes immediately

      By SeekingTanis · Posted 1 hour ago

      When  I try to launch forge, there are roughly 20 seconds when it might work and then the Minecraft launcher shows up saying that there was an unexpected issue and the game crashed. I can't seem to get a crash report and I don't know what to do!
    • JMAS
      Gradle launches Minecraft, then hangs demanding open mods folder.

      By JMAS · Posted 1 hour ago

      UPDATE:  Apparently the problem is allowing IntelliJ to update to the latest version of Gradle (4.9), when the MDK build.gradle is set to "3.+".  By refusing to allow a fresh install of IntelliJ to upgrade Gradle the build process completed, genintellijRun completed, and Minecraft loaded. Please feel free to close this issue. 
  • Topics

    • Wooofles
      5
      Failed to synchronize data from server.

      By Wooofles
      Started August 30

    • SeekingTanis
      1
      Forge will not launch, crashes immediately

      By SeekingTanis
      Started 1 hour ago

    • solitone
      12
      Distinguish singleplayer vs. multiplayer

      By solitone
      Started Thursday at 08:20 PM

    • JMAS
      2
      Gradle launches Minecraft, then hangs demanding open mods folder.

      By JMAS
      Started Yesterday at 03:02 PM

    • DragonITA
      24
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA
      Started Monday at 10:06 AM

  • Who's Online (See full list)

    • Yanny7
    • AntonBespoiasov
    • MattNL
    • DaemonUmbra
    • Redstoneguy129
    • TheKingElessar
    • Willbl3pic
    • byPablo3112
    • plugsmustard
    • DragonITA
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.14.2] Keyboard listener
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community