Skip to content

A node.js module that enables you to create virtual keyboard input on Mac OS X.

License

Notifications You must be signed in to change notification settings

ctwhome/node-mackeyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mackeyboard

A node.js module that enables you to create virtual keyboard input on Mac OS X. See in [npmjs.js] (https://www.npmjs.org/package/mac-keyboard)

Credits

Uses NodObjC to hook into the Cocoa framework. The mackeyboard module is merely a wrapper around key control commands to the Cocoa framework via NodObjC. Special thanks to Loknar

Installation

Install using npm,

$ npm install mac-keyboard

Usage Example

var pressKey = function(key){
    // Key to press
    key = key || 125;

    // Keyboard key event
    var keyEvent = $.CGEventCreateKeyboardEvent(null, key, true);
    
    // Fire event
    $.CGEventPost($.kCGHIDEventTap, keyEvent);

    console.log("Key fired: ", key);
}

Keyboard Codes

Keyboard Keys

License

(MIT License)

About

A node.js module that enables you to create virtual keyboard input on Mac OS X.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published