knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%", 
  fig.width = 10, 
  fig.height = 4.5,
  dpi = 300
)

ggkeyboard

Lifecycle: experimental

ggkeyboard lets you plot a keyboard and change the colours on it. This package is very experimental, so expect breaking changes as I work through making all the customization options as friendly as possible.

You can install ggkeyboard from github:

# install.packages("devtools")
devtools::install_github("sharlagelfand/ggkeyboard", ref = "main")

Usage

Plot a keyboard using ggkeyboard(). The default is very cute:

library(ggkeyboard)

ggkeyboard()

Colour palettes

You can change the colours, font, sizes, etc. There are a few built in colour palettes, available via keyboard_palette():

library(scales)

show_col(keyboard_palette("serika"))

This keyboard is inspired by the Drop + Zambumon MT3 Serika Custom Keycap Set:

ggkeyboard(palette = keyboard_palette("serika"))

This one is inspired by the Melgeek MG Wahtsy ABS Doubleshot Keycap Set:

ggkeyboard(palette = keyboard_palette("wahtsy"))

and this one by the Domikey ABS Doubleshot SA Cyberpunk Pumper Keycap Set:

ggkeyboard(palette = keyboard_palette("cyberpunk"))

Layouts

ggkeyboard() defaults to using a tenkeyless keyboard, available in tkl:

head(tkl)

There is also a full keyboard layout available via full. This palette is based off the Varmilo VA108 Fullsize Keyboard

ggkeyboard(full, palette = keyboard_palette("varmilo"), font_size = 2.75)

a 60% layout available via sixty_percent (colour palette based off the Drop + T0mb3ry SA Yuri Custom Keycap Set):

ggkeyboard(sixty_percent, palette = keyboard_palette("t0mb3ry"), adjust_text_colour = FALSE)

and a mac layout, based off the Apple magic keyboard:

ggkeyboard(mac, palette = keyboard_palette("magic"))

You can use an ISO layout by changing layout to "iso", for any of the given keyboards:

ggkeyboard(tkl, layout = "iso")

Highlighting

You can use highlight_keys() to emphasize any keys - for example, to highlight what keys make up the shortcut for the pipe (%>%):

ggkeyboard(tkl) %>%
  highlight_keys(c("Alt Left", "Shift Left", "M"))


sharlagelfand/ggkeyboard documentation built on Dec. 20, 2020, 9:56 p.m.