Git Product home page Git Product logo

roblox-keycombination's Introduction

KeyCombination For Roblox

Simple Key Combination system in Roblox

欢迎使用KeyCombination

这是一款为Roblox打造的简单快捷键绑定系统

  • 本库仅支持简单快捷键 格式 ctrl + alt + shift + tab + esc + ANY (可选
  • 可以使用 Lib:SimpleSetup() 快速安装
    • ANY 项应当是大写字母 总之是要对应 KeyCode.Name

|注意事项 Matters Needing Attention|

  • 可用的KeyCode: LeftShift LeftControl LeftAlt Tab Escape Space Return ANY
  • 可用的简写 (不区分大小写): shift ctrl alt tab esc space enter
  • 要求快捷键长度最低大于 1
  • 为了效率 本库没有Key Buffer. 所以不支持像 ctrl+k s 这样的复合组合键

Example:

local KeyCombo = Require "KeyCombination";
KeyCombo:SimpleSetup()

local function Example()
  print("Hello World!");
end
KeyCombo:BindCombo("LeftShift LeftAlt A",Example)
-- It can be replaced by:  KeyCombo:BindCombo("shift alt A",Example)
-- Also can be:  KeyCombo:BindCombo("sHiFt AlT A",Example)
  • 注: Release() 可以加自定义参数 所以用 SimpleSetup() 不是必要的

Example Ex:

local KeyCombo = Require "KeyCombination";

local function Example(num)
  print("The number is "..num);
end
KeyCombo:BindCombo("shift A",Example)

-- Suppose I held shift ↓
KeyCombo:Release(Enum.KeyCode.A, 9.0) -- > The number is 9

Functions:

  • 绑定按键 Bind Key Combination
KeyCombination:BindCombo(str :string, Action :(any)->(any))
  • 快速安装 Simple Setup
KeyCombination:SimpleSetup()
  • 应用结果 Release Key Input ( 没有使用 SimpleSetup() 的时候使用. / Use it when SimpleSetup() is didn't called.
KeyCombination:Release(KeyCode: Enum.KeyCode, ...) -- Should be placed under input event

roblox-keycombination's People

Contributors

xorice avatar

Stargazers

 avatar itstermoh avatar  avatar VoID avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.