Giter Club home page Giter Club logo

capture's Introduction

Capture

Lightweight Luau userinput capture and cleanup

Luau

Made by TommyRBLX





Warning
Capture is still under development, major changes might occur.

Note
This implementation does not feature maids, all scriptevents are handled by a separate API - Event





Why Capture?

Capture is a lightweight and easy to use UserInputService wrapper.





API

local Capture = require(...)



Capture.KeyName -> Key
Capture.A

Creates a new Key



Key:Connect(f:()->any) -> Connection
Capture.A:Connect(function() print("Pressed A") end)

Creates and returns a new Connection for Key



Key:Bind(KeyName: string|Enum.KeyCode) -> Connection
Capture.A:Bind('F')
Capture.F:Connect(...) 

Rebinds Key to a new KeyName



Connection:Disconnect() -> nil
local Connection = Capture.A:Connect(...)
Connection:Disconnect()

Disconnects the Connection Object for Key



Key:Destroy() -> nil
Capture.A:Connect(function() print("Pressed A") end):Destroy()

Destroys the Key Object and all it's Connections

API Demo

local Capture = require(...)


local APress = Capture.A:Connect(function()
	warn('Pressed A')
end)

Capture.A:Bind('M')

Capture.W:Connect(function()
	warn('Pressed W')
end)

Capture.D:Connect(function()
	warn('Pressed D')
end)

APress:Disconnect()

warn(Capture.Keys)

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.