Skip to content

Instantly share code, notes, and snippets.

@gadenbuie
Created July 29, 2020 15:07
Show Gist options
  • Save gadenbuie/192ed08d2a5909a92119758ce607b9a4 to your computer and use it in GitHub Desktop.
Save gadenbuie/192ed08d2a5909a92119758ce607b9a4 to your computer and use it in GitHub Desktop.
# devtools::install_github("sharlagelfand/ggkeyboard", ref = "main")
library(ggkeyboard)
library(dplyr)
library(ggplot2)
# mac keys
keys <- tkl
keys$r1$key[1:7] <- c("Fn", "Ctrl", "\u2325", "\u2318", "Spacebar", "\u2318", "\u2325")
keys$r1$width[1:7] <- c(rep(1.05, 4), 8.25, rep(1.25, 2))
keys$r1 <- keys$r1[-8, ]
g <- ggkeyboard(keys, font_family = "Arial Unicode MS")
g +
geom_rect(
data = g$layers[[2]]$data %>%
filter(key == "\u2318") %>%
slice(1),
aes(
xmin = x_start - 0.1,
xmax = x_end + 0.1,
ymin = y_start - 0.1,
ymax = y_end + 0.1
),
color = "yellow",
fill = NA,
size = 2
) +
geom_rect(
data = g$layers[[4]]$data %>%
filter(key %in% c("Shift", "M")) %>%
slice(1:2),
aes(
xmin = x_start - 0.1,
xmax = x_end + 0.1,
ymin = y_start - 0.1,
ymax = y_end + 0.1
),
color = "yellow",
fill = NA,
size = 2
) +
ggtitle("Ce n'est pas un clavier") +
theme(
plot.title = element_text(
family = "PilGi Regular",
size = 22,
hjust = 0.5,
color = "#f9948d"
)
)
@gadenbuie
Copy link
Author

30ad81f5-fbea-4a7d-bdf9-58b3d2aff4c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment