octalzeroes

Pentadactyl and pass through

published on 19 Mar 2014, tagged with pentadactyl

If you are not familiar with Pentadactyl it's a browser add-on for Firefox that makes it more keyboard accessible. The main feature is that it has Vim-like key bindings. This is excellent since you can control the browser simply by using your keyboard, no need to constantly reach for the mouse in order to click links. While this is good most of the time there's still moments when you need to be able to pass keys through to be interpreted by Firefox. To accomplish this the user can press Ctrl+z, the status bar will confirm that you are now in -- PASS THROUGH -- mode and Pentadactyl will no longer intercept input until the user presses the Esc key.

There are times when we wish to automate this procedure. Be it to just pass a couple of keys through or at times, all of them.

2048

2048 is a simple game where the goal is to join tiles of the same number together in order to finally achieve a tile with the number 2048. It may not sound like much but it's really addictive! The instructions are very simple:

Use your arrow keys to move the tiles.

This game only expects the arrow keys. So instead of passing all keys through we will let Pentadactyl know that we only need four of them. By hitting the : key we will be put into Command Line mode. From here we can change the value of passkeys:

:set passkeys+=gabrielecirulli.github.io/2048/:<Up><Down><Left><Right>
  • Append (+=) to passkeys
    • url followed by delimiter : and the keys to pass through

Droplet Console Access

A droplet is just another word for a virtual server over at DigitalOcean (warning: ref link). Most of the time you will probably access your droplet through ssh, but at times a problem might arise that leaves you with no connectivity and you must intervene. Fear not, DO will give you access to your machine through a very stylish HTML5 Console Viewer. This can be found in your Control Panel under Droplets and Access. To make Pentadactyl always pass all of your keys through to this particular URL we can insert the following command:

:autocmd LocationChange 'https://cloud.digitalocean.com/droplet/console/*' :normal! <C-z>
  • autocmd automatically executes code on events
    • the event is LocationChange, this triggers when changing tabs or when you navigate to a new location
    • match the location
    • execute key mapping Ctrl+z, the ! makes sure only builtin key mappings are executed

To make the changes persistent you can either execute the command :mkp to save your current configuration or you can manually create and manage a configuration file with the settings (make sure you skip the leading : in front of each command). Pentadactyl will look for this file in the following locations:

  • Windows: %USERPROFILE%\_pentadactylrc
  • Linux: ~/.pentadactylrc