Get pressed key

Discussion in 'Plugin Development' started by kevin3220, Jul 28, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    kevin3220

    Hi, is it possible to get a pressed key?;D
     
  2. Offline

    Hoot215

    Not without Spout + Spoutcraft or some other client mod.
     
  3. kevin3220
    No, but you can kind of get WASD and space (or whatever their movement keys are) with PlayerMoveEvent. Use getFrom and getTo methods for x, y and z, then compare the values.
     
  4. Offline

    kevin3220

    but then players need a spout client not a usual client?
     
  5. Offline

    Hoot215

    Yes, unless you want to check the WASD or space keys like Assist suggested.
     
  6. Offline

    kevin3220

    But is it possible to get MMB? Because in creative u can use MMB. Is it possible to get MMB pressed?
     
  7. Offline

    xWatermelon

    dafuq is MMB
     
  8. Offline

    inventorman101

    You can also get Q (when item is dropped) and cancel the event
     
  9. Offline

    kevin3220

    MMB stands for Mouse Middle Button.

    How do i get Q ? ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  10. Offline

    Tarestudio

    kevin3220
    You cant get any pressed button or key. What you can get, is the servers reaction on it. So WASD and Space will trigger PlayerMoveEvent, requiring the client uses default keymap. If someone uses IJKL and Enter for Movement, it will be this keys, but the server will never know this. Its just Movement.
    Look what Events the API offers you and think about what key on clientside should trigger which event.
     
Thread Status:
Not open for further replies.

Share This Page