▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/CMD + Delete
CMD + Delete

CMD + Delete

A text navigation and editing shortcuts framework for Minecraft, allowing macOS users to experience native text editing behavior and everyone else to define their own custom shortcuts.

Оцените первым
447
2

CMD + Delete

In Minecraft on macOS, pressing option and backspace deletes a single character, and pressing command and backspace deletes a word. This is completely inconsistent with the native OS, so I fixed it:

Not only does CMD + Delete fix the macOS text behavior, it also expands Minecraft into a fully user-configurable text editing/navigation shortcut framework!

Important Context

  1. If you use this mod on Windows or Linux, and you don't use custom mappings, nothing will change from vanilla Minecraft.
  2. If you have any problems with this mod, please report them as Issues on GitHub. This mod is Open Source and Pull Requests are very much welcome! :)

NOTE:

CMD + Delete is available for NeoForge only on 1.21.1 with Sinytra Connector!

Custom Mappings

You can define your own custom mappings in configuration files with the location & name: <minecraft install>/config/cmd_delete/mappings/<id>.json. These allow you to customize the text navigation shortcut behavior in Minecraft for your own taste & configuration.

Examples

sample.json:

{
  "fv": 2,
  "inherits": "builtin:mac",
  "meta": {
    "name": "Example custom mapping",
    "author": "Omegabird113",
    "description": "This example demonstrates inheritance, patching, and more! Though, these keybinds are made up and people wouldn't use these most likely...",
    "version": "2.1.0",
    "id": "sample",
    "systems": [
      "mac", "windows", "linux"
    ]
  },
  "actions": {
    "NAV_TEXT_START": [
      {
        "key": "up",
        "superCommand": true,
        "altOption": false,
        "shift": false,
        "enabled": false
      },
      {
        "key": "e",
        "superCommand": true
      },
      {
        "key": "home"
      }
    ]
  }
}

mac.json:

{
  "fv": 2,
  "meta": {
    "name": "Mac mappings",
    "author": "Omegabird113",
    "description": "This is actually a copy of the built-in macOS mappings for CMD + Delete 1.2.0!",
    "version": "1.0.0",
    "id": "mac",
    "systems": ["mac"]
  },
  "actions": {
    "NAV_TEXT_START": [
      {"key": "up", "superCommand": true, "altOption": false, "shift": false}
    ],
    "SEL_TEXT_START": [
      {"key": "up", "superCommand": true, "altOption": false, "shift": true}
    ],
    "NAV_TEXT_END": [
      {"key": "down", "superCommand": true, "altOption": false, "shift": false}
    ],
    "SEL_TEXT_END": [
      {"key": "down", "superCommand": true, "altOption": false, "shift": true}
    ],
    "NAV_LINE_LEFT": [
      {"key": "left", "superCommand": true, "altOption": false, "shift": false}
    ],
    "SEL_LINE_LEFT": [
      {"key": "left", "superCommand": true, "altOption": false, "shift": true}
    ],
    "NAV_LINE_RIGHT": [
      {"key": "right", "superCommand": true, "altOption": false, "shift": false}
    ],
    "SEL_LINE_RIGHT": [
      {"key": "right", "superCommand": true, "altOption": false, "shift": true}
    ],
    "NAV_WORD_LEFT": [
      {"key": "left", "superCommand": false, "altOption": true, "shift": false}
    ],
    "SEL_WORD_LEFT": [
      {"key": "left", "superCommand": false, "altOption": true, "shift": true}
    ],
    "NAV_WORD_RIGHT": [
      {"key": "right", "superCommand": false, "altOption": true, "shift": false}
    ],
    "SEL_WORD_RIGHT": [
      {"key": "right", "superCommand": false, "altOption": true, "shift": true}
    ],
    "DEL_LINE_LEFT": [
      {"key": "backspace", "superCommand": true, "altOption": false}
    ],
    "DEL_LINE_RIGHT": [
      {"key": "delete", "superCommand": true, "altOption": false}
    ],
    "DEL_WORD_LEFT": [
      {"key": "backspace", "superCommand": false, "altOption": true}
    ],
    "DEL_WORD_RIGHT": [
      {"key": "delete", "superCommand": false, "altOption": true}
    ],
    "SEL_TEXT_UP": [
      {"key": "up", "superCommand": false, "altOption": false, "shift": true}
    ],
    "SEL_TEXT_DOWN": [
      {"key": "down", "superCommand": false, "altOption": false, "shift": true}
    ]
  }
}

Features

Custom mappings can:

  • You don't have to define every modifier combination, because key modifiers use wildcard expansion where any modifier not included is treated as true OR false.
  • You don't have to memorize raw GLFW keycodes, as CMD + Delete provides support for using friendly keyname strings defined by it instead. If a keyname is not defined, you can still choose to use a raw GLFW keycode in your JSON.
  • Inherit keybinds from the builtin mappings or other custom mappings by setting the top-level inherits value to custom:<id> to inherit a custom JSON, or builtin:<id> or just <id> to inherit a builtin JSON.
  • They can patch & override the mappings they inherit by setting the keybind to have enabled property as false. Note that CMD + Delete always removes your disabled keybinds before adding your enabled keybinds, allowing a patch-then-reimplement pattern to be easily done.

Note that:

  • The format version fv is currently 2 and your mappings should match that.
  • The meta.id field must exactly match the filename

The /navmappings command

CMD + Delete includes an in-game, client /navmappings command for checking, switching, importing, exporting, and debugging mappings without manually touching config files.

Here are all the subcommands:

  • /navmappings info: displays info about the currently loaded mappings.
  • /navmappings list: displays a list of the namespaced IDs of the currently available mappings, which you could switch to.
  • /navmappings set default: switch to the default mappings behavior.
  • /navmappings set builtin <non-namespaced id>: switch a specific OS's builtin mappings JSON.
  • /navmappings set custom <non-namespaced id>: switch to one of your own custom mappings JSONs.
  • /navmappings reload: reload the currently active mappings.
  • /navmappings export <type> <non-namespaced id> <absolute location>: make a copy of a mappings JSON to another location on your system so you can copy it.
  • /navmappings import <non-namespaced id> <absolute location>: import a copy of a JSON you made from another location on your system into the custom JSONs folder for you to use as custom mappings.
  • /navmappings debug: a utility that provides dumps of information like info about CMD + Delete, a dump of the friendly keynames which CMD + Delete mappings JSONs support, or a raw dump of the internal loaded mappings' registry.

Builtin Mappings' Shortcuts

By default, CMD + Delete will detect if you're using macOS, and if you are it'll set you to those shortcuts, otherwise it will set you to use Windows/Linux shortcuts.

ActionmacOSWindows / Linux
Delete previous wordoption + backspacectrl + backspace
Delete next wordoption + deletectrl + delete
Delete to start of linecmd + backspaceN/A
Delete to end of linecmd + deleteN/A
Move to previous wordoption + ctrl +
Move to next wordoption + ctrl +
Move to start of linecmd + home
Move to end of linecmd + end
Move to start of textcmd + ctrl + home
Move to end of textcmd + ctrl + end
Select to previous wordoption + shift + ctrl + shift +
Select to next wordoption + shift + ctrl + shift +
Select to start of linecmd + shift + shift + home
Select to end of linecmd + shift + shift + end
Select to start of textcmd + shift + ctrl + shift + home
Select to end of textcmd + shift + ctrl + shift + end
Select up one lineshift + shift +
Select down one lineshift + shift +

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

26.2.x26.1.x1.21.x1.20.x1.19.x1.18.x1.17.x

Платформы

Поддерживаемые окружения

Клиент

Зависимости

Forgified Fabric APIForgified Fabric APISinytra ConnectorSinytra ConnectorFabric APIFabric API

и ещё 1 зависимостей

Ссылки

Детали

Лицензия:
Опубликован:5 месяцев назад
Обновлён:3 недели назад
Главная