[Librari][V0.2] Simple Key - Keyboard input - New version is out.

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
MateConBigote
Prole
Posts: 3
Joined: Tue Aug 08, 2017 3:34 am
Contact:

[Librari][V0.2] Simple Key - Keyboard input - New version is out.

Post by MateConBigote »

Simple Key

Description

Simple Key is a simple yet awesome input library for Love2d. The objective of this library is to make the keyboard input handle easy in a small and compact way. The library is aimed to be used in small proyects.

Motivations

There is a lot of input libraries for Love2d, but all of them are big and complex, and can be a little over kill use a library that can handel joystick and touch screen for a small project, so I made this.

Usage

Code: Select all

key = require('simpleKey')

function love.load()
    key:keyInit({'space'})
end

function love.update(dt)
    key:updateInput()
    if key:justPressed('space') then print('space just pressed') end
    if key:isDown('space') then print('space dawn') end
    if key:isReleased('space') then print('space got relised') end
end
API

Code: Select all

        keyInit() -- Init all variables.
        keyBind() -- Bind a key or a table of keys.
        keyUnbind() -- Unbind a key or a table of keys.
        updateInput() -- Update the state of all bound keys.
        justPressed() -- Return true on the first frame that a bound key is down.
        isDown() -- Return true if a bound key is down.
        isReleased() -- Return true if a bound key relesed in this frame.
        checkDown() -- Check if a key is dawn, this key don't need to be bound.
Code in GitHub
English is not my first language and I never took an English class, feel free to correct any error or misspelling.
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: [Librari][V0.2] Simple Key - Keyboard input - New version is out.

Post by D0NM »

There are a lot of input libs here.
one of the problem is dynamical connecting - disconnecting gamepads
during the gameplay.

I have to mod existing libs. Do you have any ideas how to manage such stuff?
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests