How to use the keypress.enableMouse function in keypress

To help you get started, we’ve selected a few keypress examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github icyflame / cli-cube-timer / index.js View on Github external
process.stdin.on('mousepress', function (click) {
    if (click.release) {
      space_or_mouse();
    }
  });

  process.on('exit', function () {
    //disable mouse on exit, so that the state is back to normal for the terminal.
    keypress.disableMouse(charm);
  });

  process.stdin.resume();

  charm.reset();
  keypress.enableMouse(charm);
  botSay("Hey! Let's start solving!");
  botSay('The session starts now!');

  start_inspect = print_help(right_row_num, 1);

  charm.position(1, start_inspect)
  start_inspect += prepNewSolve();

  start_time = (new Date()).toTimeString().split(' ')[0]

  var total_time = new Stopwatch();
  total_time.start();
  charm.position(1, start_inspect);
};
github sidorares / ansi-vnc / index.js View on Github external
#!/usr/bin/env node

var ac = require('ansi-canvas');
var term = ac();
var rfb = require('rfb2');
var argv = require('optimist').argv;

var keypress = require('keypress');
keypress(process.stdin);
keypress.enableMouse(process.stdout);
setRawMode(true);

function setRawMode(val) {
  if (process.stdin.setRawMode)
    process.stdin.setRawMode(val);
  else
    require('tty').setRawMode(val);
}

var canvas, ctx;

function scaleFactor() {
  var oldWidth = canvas.width;
  var oldHeight = canvas.height;
  var maxWidth = term.width;
  var maxHeight = term.height;

keypress

Make any Node ReadableStream emit "keypress" events

MIT
Latest version published 11 years ago

Package Health Score

65 / 100
Full package analysis