--- title: "Input API - Sorted wiki" description: "Ask Sorted to leave Alt on items to your mod." url: https://voxelsprout.com/sorted/wiki/input-api --- [Sorted](https://voxelsprout.com/sorted) [Wiki](https://voxelsprout.com/sorted/wiki)Input API # Input API Ask Sorted to leave Alt on items to your mod. In an inventory, Sorted uses Alt+click on an item for the [The keep list](https://voxelsprout.com/sorted/wiki/keep-list), Alt+Shift+click for the [The blacklist](https://voxelsprout.com/sorted/wiki/blacklist) and Alt+scroll for the keep count, and shows its marks while Alt is held. If your mod uses Alt on items too, ask Sorted to step aside, and the click goes to your mod alone. From Sorted **0.1.42**. ```java // From your client initializer, or whenever your own Alt gesture is switched on. SortedInput.yieldAlt("mymod"); // Your gesture is off again: Sorted's come back once no mod asks. SortedInput.releaseAlt("mymod"); ``` Sorted's own buttons are not part of this: Alt+click on Sort is still a compact sort. ## The player decides [**Alt on items**](https://voxelsprout.com/sorted/wiki/settings#setting-alt-on-items) in Sorted's settings has the last word. **Automatic**, the default, steps aside while any mod asks. **On** keeps Sorted's gestures whatever mods ask, **Off** turns them off without one. The setting names the mods that asked. ## Without a compile dependency ```java try { Class.forName("com.sorted.api.SortedInput").getMethod("yieldAlt", String.class).invoke(null, "mymod"); } catch (ReflectiveOperationException e) { // Sorted is not installed, or older than 0.1.42. Nothing to do. } ``` ## Reference | SortedInput | What it does | | ------------------------ | ---------------------------------------------------------------------------------------------- | | yieldAlt(String owner) | Sorted's Alt gestures on items step aside for you until releaseAlt. | | releaseAlt(String owner) | They come back once no mod asks. | | altOwners() | The mods that asked, in the order they asked. | | altGesturesOn() | Whether they are on now, the setting and the requests taken together. Cheap, fine every frame. | | isAvailable() | Sorted is running, in a world, and not off on this server. | ## Next, you may want to * [Keep protected slots out of sortsProtection API](https://voxelsprout.com/sorted/wiki/protection-api) [Previous Protection API](https://voxelsprout.com/sorted/wiki/protection-api) Something missing or wrong on this page? Say so on [Discord](https://discord.gg/CvdkGbEW4y).