• Stars
    star
    287
  • Rank 144,232 (Top 3 %)
  • Language Vue
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Virtual keyboard component for Vue.js 2.x. Designed to Raspberry Pi Touch Display

vue-touch-keyboard NPM version VueJS v2.x compatible

Virtual keyboard component for Vue.js v2.x. Designed to Raspberry Pi Touch Display

Codacy Badge Build Status Coverage Status NPMS.io score

Dependency Status devDependency Status Downloads

If you like my work, please donate. Thank you!

Demo

JSFiddle demo Codepen demo

Screenshot

Features

  • 3 built-in layouts, but you can create custom layouts
  • no external dependencies
  • full responsive
  • customizable styles
  • ...etc

Installation

NPM

You can install it via NPM.

$ npm install vue-touch-keyboard

Manual

Download zip package and unpack and add the vue-touch-keyboard.css and vue-touch-keyboard.js file to your project from dist folder.

https://github.com/icebob/vue-touch-keyboard/archive/master.zip

Usage

<template>
  <div>
    <input type="text" placeholder="Text input" @focus="show" data-layout="normal" />
    <vue-touch-keyboard :options="options" v-if="visible" :layout="layout" :cancel="hide" :accept="accept" :input="input" />
  </div>
</template>

<script>
  import VueTouchKeyboard from "vue-touch-keyboard";
  import style from "vue-touch-keyboard/dist/vue-touch-keyboard.css"; // load default style

  Vue.use(VueTouchKeyboard);

  export default {
    data: {
      visible: false,
      layout: "normal",
      input: null,
      options: {
        useKbEvents: false,
        preventClickEvent: false
      }
    },

    methods: {
        accept(text) {
          alert("Input text: " + text);
          this.hide();
        },

        show(e) {
          this.input = e.target;
          this.layout = e.target.dataset.layout;

          if (!this.visible)
            this.visible = true
        },

        hide() {
          this.visible = false;
        }
    }
  }
</script>

Properties

Property Default Accepted values Description
input required HTMLInputElement The target input HTML element
layout required String or Object Layout of keys. If you are using the built-in layouts, you can set as the name of the layout. If you want to use custom layout, you need to set a layout Object.
accept null Function Event handler. Fired when the "Accept/Close" button pressed.
cancel null Function Event handler. Fired when the "Cancel" button pressed.
change null Function Event handler. Fired when the input value changed.
next null Function Event handler. Fired when the "Next" button pressed or the length of the value of the input reached the maxLength of the input
options {} Object Functional options.
defaultKeySet default String Default key set. You can choose a desired key set of your layout to be used when a keyboard is initialized.

Options

Option Default Accepted values Description
useKbEvents false boolean If true, the component will generate a keydown event and trigger it. If it returns with false, it won't insert the new character.
preventClickEvent false boolean If true, the component will preventDefault the click event.

Built-in layouts

  • normal - Normal full layout. Similar as real keyboard layouts
  • numeric - Only for numbers
  • compact - Compact layout. Similar as mobile phone keyboard layouts

Development

This command will start a webpack-dev-server with content of dev folder.

npm run dev

Build

This command will build a distributable version in the dist directory.

npm run build

Test

npm test

Contribution

Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.

License

vue-touch-keyboard is available under the MIT license.

Contact

Copyright (C) 2016 Icebob

@icebob @icebob

More Repositories

1

vue-express-mongo-boilerplate

⭐ MEVN Full stack JS web app boilerplate with NodeJS, Express, Mongo and VueJS
JavaScript
2,847
star
2

fastest-validator

⚡ The fastest JS validator library for NodeJS
JavaScript
1,420
star
3

vue-websocket

Simple websocket (socket.io) plugin for Vue.js
JavaScript
533
star
4

fakerator

Random fake data generator with localization for Javascript in Node.js and browser
JavaScript
136
star
5

kantab

[WIP] Kanban board application. Powered by Moleculer & Vue.JS
JavaScript
131
star
6

microservices-benchmark

Benchmark of microservices frameworks for NodeJS
JavaScript
38
star
7

benchmarkify

⚡ Benchmark framework for NodeJS
JavaScript
29
star
8

hasznaltauto-figyelo

Autó figyelő alkalmazás a hasznaltauto.hu oldalhoz
JavaScript
25
star
9

fullstack-moleculer

Fullstack moleculer Proof-of-Concept project. Moleculer in browser and on server.
JavaScript
24
star
10

validator-benchmark

JS validators benchmark
JavaScript
23
star
11

moleculer-protect-services

Protect services
JavaScript
22
star
12

propertiesjs

Javascript properties editor
JavaScript
20
star
13

codepen_offline

Codepen's pen offline coding with livereload
JavaScript
18
star
14

layout-editor

Layout Editor in browser
JavaScript
15
star
15

coffeescript_cheatsheet

CoffeeScript cheatsheet
14
star
16

IceTabSet

This is a 'Google Chrome style' TTabSet component for Delphi.
Pascal
8
star
17

docker-chromium-armhf

Docker container with Chromium browser for Raspberry Pi
Dockerfile
6
star
18

moleculer-sandbox

Moleculer sandbox project
JavaScript
5
star
19

go-http-framework-benchmark

Go (Golang) HTTP framework benchmark test
Go
5
star
20

js-perf-benchmark

Javascript Performance Benchmark
JavaScript
4
star
21

moleculer-opentelemetry-demo

OpenTelemetry demo project for Moleculer
JavaScript
4
star
22

moleculer-pattern

[PoC] Pattern-matching middleware for Moleculer
JavaScript
4
star
23

web-vnc-client

Web-based VNC client
JavaScript
3
star
24

bench-bot

👷 Benchmark runner robot. Continuous benchmarking
JavaScript
3
star
25

moleculer-ts-demo

TS demo
TypeScript
2
star
26

ICEdit

ICEdit is a web-based IDE
JavaScript
2
star
27

node-deno-bun-benchmark

JavaScript
1
star
28

kintohub-moleculer

Moleculer example project for KintoHub
JavaScript
1
star
29

stackblitz-moleculer-project-demo

Created with StackBlitz ⚡️
HTML
1
star
30

webpack-moleculer

JavaScript
1
star
31

moleculer-sidecar-hemera

Moleculer <-> Hemera sidecar/gateway
JavaScript
1
star
32

ga-discord-demo

1
star
33

gfs-cleaner

GFS backup retention tool.
Go
1
star