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
  • [SOLVED] Mouse "Keybinding?"
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
intermediateuser

[SOLVED] Mouse "Keybinding?"

By intermediateuser, June 20, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

intermediateuser    1

intermediateuser

intermediateuser    1

  • Stone Miner
  • intermediateuser
  • Members
  • 1
  • 57 posts
Posted June 20, 2013

So I know how to set a keybinding already.  When I'm looking for the G key, for example, I'd use Keyboard.KEY_G

 

What if I'm looking for Mouse Button 3?  The game already uses it for "Pick Block" (so I know it's possible) but Pick Block is essentially useless in the Survival game type so I'd like to have my mod remap it to something more useful.

  • Quote

Share this post


Link to post
Share on other sites

Mew    36

Mew

Mew    36

  • Dragon Slayer
  • Mew
  • Members
  • 36
  • 567 posts
Posted June 20, 2013

I have never looked into this myself.... But wouldn't it be logical (if the keybindings use Keyboard) to assume that it would be Mouse.nameOfVariable?

  • Quote

Share this post


Link to post
Share on other sites

intermediateuser    1

intermediateuser

intermediateuser    1

  • Stone Miner
  • intermediateuser
  • Members
  • 1
  • 57 posts
Posted June 20, 2013

I have never looked into this myself.... But wouldn't it be logical (if the keybindings use Keyboard) to assume that it would be Mouse.nameOfVariable?

 

Quite logical!  And I have looked into that.  It is not as straightforward as the keyboard stuff.  Thus I asked here.

  • Quote

Share this post


Link to post
Share on other sites

Mew    36

Mew

Mew    36

  • Dragon Slayer
  • Mew
  • Members
  • 36
  • 567 posts
Posted June 20, 2013

I have never looked into this myself.... But wouldn't it be logical (if the keybindings use Keyboard) to assume that it would be Mouse.nameOfVariable?

 

Quite logical!  And I have looked into that.  It is not as straightforward as the keyboard stuff.  Thus I asked here.

 

Well then.. I have no idea xD Try looking through source code... But have fun with that.

  • Quote

Share this post


Link to post
Share on other sites

intermediateuser    1

intermediateuser

intermediateuser    1

  • Stone Miner
  • intermediateuser
  • Members
  • 1
  • 57 posts
Posted June 20, 2013

I have never looked into this myself.... But wouldn't it be logical (if the keybindings use Keyboard) to assume that it would be Mouse.nameOfVariable?

 

Quite logical!  And I have looked into that.  It is not as straightforward as the keyboard stuff.  Thus I asked here.

 

Well then.. I have no idea xD Try looking through source code... But have fun with that.

 

Haha, well, thanks.  I'll post here if I find anything.

 

In the meantime, if anyone else knows, please feel free to race me to posting the solution.  :P

  • Quote

Share this post


Link to post
Share on other sites

intermediateuser    1

intermediateuser

intermediateuser    1

  • Stone Miner
  • intermediateuser
  • Members
  • 1
  • 57 posts
Posted June 20, 2013

Got it.

 

Mouse 3 (middle click, usually) is assigned integer -98 in the keybindings.  So if you're looking for a particular "key" in your code where you would normally use Keyboard.KEY_whatever (which is actually just a fancy name for an integer assigned to that key), you'd simply type "-98" (without the quotes, of course).

 

I figured this out by having another key call this when pressed:

 

System.out.println(Minecraft.getMinecraft().gameSettings.keyBindPickBlock.keyCode);

 

You can get any of the game's keybindings that way (though I don't imagine you'd need to except if you were looking for mouse buttons).  Just be sure to delete the above line of code when you've got the information you need.

 

Huh.  Just noticing that I used a lot of parenthesis in this post (and that's probably okay).  :P

  • 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 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • AdieCraft
      Japanese Style Temple Base

      By AdieCraft · Posted 42 minutes ago

      Hello there!   Check out my latest tutorial in my Japanese Builds series, building a Japanese Temple base.   Make sure to Subscribe, so you don't miss any future videos.   Thanks   Adie   Japanese Style Temple Base    
    • DaemonUmbra
      Forge crashes on start

      By DaemonUmbra · Posted 1 hour ago

      Forge for 1.13+ requires Java 8-10 Forge for 1.12.2- requires Java 8
    • GttiqwT
      [1.12.2] Multiple Structure Generation

      By GttiqwT · Posted 1 hour ago

      Yeah I get where you're coming from. I also watched harry talk's tutorial and at first it worked but then I got the problem that it wont spawn more than one structure otherwise it'll overlap and only spawn the latest one added. I tried to follow this tutorial again and it just didnt seem to work at all now. When I get more time ill have to do it again and then afterwards try and fix the issues with spawning more than one structure. I'm currently trying to fix the issue where it causes cascading gen lag but I dont know how to fix that quite yet either.
    • Draco18s
      Distinguish singleplayer vs. multiplayer

      By Draco18s · Posted 2 hours ago

      No. Your client code is sending information to make the server do things. Your server code is telling the server to do those same things (again).
    • solitone
      Distinguish singleplayer vs. multiplayer

      By solitone · Posted 2 hours ago

      This isn’t an issue but normal behaviour, is it?
  • Topics

    • AdieCraft
      0
      Japanese Style Temple Base

      By AdieCraft
      Started 43 minutes ago

    • bitman
      1
      Forge crashes on start

      By bitman
      Started 2 hours ago

    • Merthew
      7
      [1.12.2] Multiple Structure Generation

      By Merthew
      Started November 7, 2018

    • solitone
      24
      Distinguish singleplayer vs. multiplayer

      By solitone
      Started December 5

    • TheGreenSquarez
      5
      Forge 28.1.10 won't show on launcher + 28.1.0 fails to work

      By TheGreenSquarez
      Started Wednesday at 11:21 AM

  • Who's Online (See full list)

    • Adorablorp
    • vnldwth
    • prozed
    • enduringgamer
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [SOLVED] Mouse "Keybinding?"
  • Theme
  • Contact Us
  • Discord

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