EasyKeyJS - Keyboard Shortcuts in Web Apps & SaaS's

Ryuzaki

お前はもう死んでいる
Moderator
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
6,229
Likes
13,100
Degree
9
If you guys have ever tried to code keyboard shortcuts or even keyboard commands in javascript or actionscript, you know it's a giant pain the butt.

Enter easykeyjs - http://www.blinkingcaret.com/2016/02/24/easykeyjs/

Whoever it is that runs The Blinking Caret decided to create a library of functions that greatly reduces the complexity of creating these commands while giving it an intuitive syntax.

For example, this:
Code:
$(document).keydown(function(e){
    if (e.which == 13) //enter
    reloadResults();
   else if (e.which == 37) //left arrow
    previousPage();
   else if (e.which == 39) //right page
    nextPage();
});

becomes:
Code:
$(document)
    .onEnterKeyDown(reloadResults)
    .onLeftArrowKeyDown(previousPage)
    .onRightArrowKeyDown(nextPage);

I know there's lots of established and hopeful SaaS guys on here. If you have an app that people LIVE IN on the desktop, giving these types of shortcuts is a godsend once they are learned.

This is the hero your customers need and deserve (or however the Batman quote goes).
 
Cool. That's pretty baller, and simple to boot.
 
I recently installed easykeyjs in my main SAAS. Users can now use "ctrl + c" or "option + c" to clear notifications. The only thing I would say is you have to be careful on what keys you assign since I was originally not thinking and tried "cmd + c" which is the native copy command, and it wasn't working for some reason, until I started using my brain. Overall I highly recommend easykeyjs to anyone with a SAAS or web App cause there are those users which just love that keyboard.
 
Back