项目作者: pschichtel

项目描述 :
Scan barcodes from your screen and emit the content as key strokes.
高级语言: Kotlin
项目地址: git://github.com/pschichtel/VirtualScanner.git
创建时间: 2018-03-10T02:14:09Z
项目社区:https://github.com/pschichtel/VirtualScanner

开源协议:Other

下载


VirtualScanner

Scan barcodes from your screen and emit the content as key strokes.

The barcode scanning uses the zxing library, which is also commonly used in Android projects. If scanning does not work with specific barcode it is most likely due to this library not supporting the barcode.

Usage

java -jar virtual-scanner.jar [mode] [configuration]

  • [mode]: The mode (see below) to start in. Can be omitted.
  • [configuration]: The configuration file to load. Can be omitted and defaults to config.json.

Modes

  • screen: Scans all screens once for barcodes. This mode will be used if no mode has been specified.
  • clipboard: Continuously scans the clipboard for images and scans them for barcodes.
  • layout: A small UI to customize the character-key-mapping.

Configuration

A JSON file is loaded which configures to tool. The file can be specified or defaults to config.json.

  1. {
  2. "layout": "layout.json",
  3. "normalizeLinebreaks": true,
  4. "prefix": [],
  5. "suffix": [],
  6. "delay": 1000,
  7. "charset": "abc"
  8. }

If the file is not found, defaults will be loaded: Default config.json on Github.

  • layout: The layout file to map characters to keys on the keyboard. Relative paths will be relative to the working directory. The file layout.json will be loaded internally with defaults, if it does not exist.
  • normalizeLinebreaks: Whether to normalize the linebreaks to \n.
  • prefix: The key actions to generate before the barcode content.
  • suffix: The key actions to generate after the barcode content.
  • delay: The delay before the tool starts producing key events after detecting the barcode in milliseconds.
  • charset: The characters to map in the layout file, used by the layout mode.

Download

Get the tool from the latest release on Github!

Building

It is a standard Maven project that does not require any special configuration given a working Maven installation. mvn clean package should build an executable jar into the target folder.

Action Sequence Syntax

  • +10 -> Press key with code 10 down
  • -10 -> Release key with code 10
  • ~10 -> Press and release key with code 10

Testing

Try generating QR codes using e.g. this website. And make screenshots of them or copy the image directly to the clipboard.