CTRL+Q Key press (how?)

Discussion in 'Spigot Plugin Development' started by Subtelny, May 5, 2017.

  1. Hello! (Sorry for my english)
    How can I check when player uses CTRL key while pressing Q (drop key?)
    (SHIFT+Q is simply check player.isSneaking and drop event but what with CTRL?)
    I saw this on another server. (When I click CTRL+Q, server show me gui)
  2. You can't I don't think. The server you were on must have been modded. And what's wrong with shift + q?
  3. Unless there is a button has a trigger sorry but you cant bind it to anything..
  4. The left Ctrl button is default set to Sprint. So, similar to checking isSneaking() for pressing Shift, you want to check isSprinting() for the left Ctrl button. Be weary, this will trigger if the player is running normally (double tap W) and throwing items on the ground with Q button.
  5. You can check if the amount of the items dropped is higher than 1 (only works is the item that has to be dropped is higher than 1)
  6. Maybe you can listen the PlayerDropItemEvent and check if the player has an inventory open using Player#getOpenInventory, if not, the player is surely dropping the item with shift+Q