-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathREADME.Rmd
112 lines (76 loc) · 2.97 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
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
<!-- badges: start -->
[](https://www.tidyverse.org/lifecycle/#experimental)
<!-- badges: end -->
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:
``` r
# install.packages("devtools")
devtools::install_github("sharlagelfand/ggkeyboard", ref = "main")
```
# Usage
Plot a keyboard using `ggkeyboard()`. The default is very cute:
```{r pastel}
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()`:
```{r palette}
library(scales)
show_col(keyboard_palette("serika"))
```
This keyboard is inspired by the [Drop + Zambumon MT3 Serika Custom Keycap Set](https://drop.com/buy/drop-zambumon-mt3-serika-custom-keycap-set):
```{r serika}
ggkeyboard(palette = keyboard_palette("serika"))
```
This one is inspired by the [Melgeek MG Wahtsy ABS Doubleshot Keycap Set](https://drop.com/buy/melgeek-mg-wahtsy-abs-doubleshot-keycap-set):
```{r wahtsy}
ggkeyboard(palette = keyboard_palette("wahtsy"))
```
and this one by the [Domikey ABS Doubleshot SA Cyberpunk Pumper Keycap Set](https://drop.com/buy/domikey-abs-doubleshot-sa-cyberpunk-pumper-keycap-set):
```{r cyberpunk}
ggkeyboard(palette = keyboard_palette("cyberpunk"))
```
## Layouts
`ggkeyboard()` defaults to using a tenkeyless keyboard, available in `tkl`:
```{r tkl}
head(tkl)
```
There is also a full keyboard layout available via `full`. This palette is based off the [Varmilo VA108 Fullsize Keyboard](https://drop.com/buy/varmilo-108-keyboard)
```{r full}
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](https://drop.com/buy/drop-t0mb3ry-sa-yuri-custom-keycap-set)):
```{r sixty}
ggkeyboard(sixty_percent, palette = keyboard_palette("t0mb3ry"), adjust_text_colour = FALSE)
```
and a mac layout, based off the Apple magic keyboard:
```{r mac}
ggkeyboard(mac, palette = keyboard_palette("magic"))
```
You can use an ISO layout by changing `layout` to "iso", for any of the given keyboards:
```{r iso}
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 (%>%):
```{r highlight}
ggkeyboard(tkl) %>%
highlight_keys(c("Alt Left", "Shift Left", "M"))
```