Giter Club home page Giter Club logo

core's Introduction

Build Status

ngx-material-keyboard

Onscreen virtual keyboard for Angular using Angular Material.

Please note that the project is at a very early stage. Therefore one should refrain from productive usage.

ngx-material-keyboard in action

Demo

A demo can be found here.

Docs

Generated documentation can be found here.

Getting started

  1. Install with your prefered packet manager (we're using npm here): npm install --save @ngx-material-keyboard/core

Be sure to fulfill the peer dependencies of this module, in particular Angular and Angular Material.

  1. Add the module to your project, e.g. app.module.ts:
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatButtonModule } from '@angular/material/button';
...
import { MatKeyboardModule } from '@ngx-material-keyboard/core';

@NgModule({
  imports: [
    // Angular modules
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,

    // Material modules
    MatButtonModule,
    MatKeyboardModule,
  ],
  ...
})
export class AppModule {}
  1. Use the MatKeyboardDirective on your input elements or textareas and set the name or locale of the layout.

If not provided the locale will be derieved from the LOCALE_ID or the browser.

<input [matKeyboard]="'Azərbaycanca'">

Providing custom layouts

Most of the base configurations are provided as injection tokens. Please read the documentation to understand how to handle it.

All layouts are based on (or directly inherited from) the angular-virtual-keyboard which is based on GreyWyvern VKI. For details on how to structure a layout see the comment derived from the original source code.

Note that this will most likely be changed in the near future. But for now a huge range of layouts is already usable because of the great contribution back then.

But basicly you just provide the configuration of your new layout in your AppModule:

import { IKeyboardLayouts, keyboardLayouts, MAT_KEYBOARD_LAYOUTS, MatKeyboardModule } from '@ngx-material-keyboard/core';

const customLayouts: IKeyboardLayouts = {
  ...keyboardLayouts,
  'Tölles Läyout': {
    'name': 'Awesome layout',
    'keys': [
      [
        ['1', '!'],
        ['2', '@'],
        ['3', '#']
      ]
    ],
    'lang': ['de-CH']
  }
};

@NgModule({
  ...
  providers: [
    { provide: MAT_KEYBOARD_LAYOUTS, useValue: customLayouts }
  ],
  ...
})
export class AppModule {}

Development

This repository is managed by and layed out for ng-packagr.

Versioning

The application uses semver and is developed with the git flow branching model.

core's People

Contributors

davidenke avatar igoodwin avatar seonetartem avatar

Stargazers

 avatar  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.