1'use strict';
2
3const EventEmitter = require('events');
4
5module.exports = new class Keypad extends EventEmitter {
6    constructor(){
7        super();
8        this._on();
9    }
10
11    open() {
12        return __native.Keypad.open();
13    };
14
15    close() {
16        this.removeAllListeners('keypadEvent');
17        return __native.Keypad.close();
18    };
19
20    _on() {
21        __native.Keypad.on(function(code, value) {
22            this.emit('keypadEvent', code, value);
23        }.bind(this));
24    };
25
26}