Skip to content

Commit

Permalink
Polishing keydef data
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Feb 8, 2024
1 parent dc931f4 commit 80a34c2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions data-raw/keydef.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ lines <- readLines(url)
first <- which(grepl("_keyDefinitions", lines))
last <- tail(which(grepl("^}", lines)), 1)



ct <- V8::v8()

def <- paste(c("keydef = {", lines[(first + 1):last]), collapse = "\n")
ct$eval(def)
keydefs <- ct$get("keydef")

usethis::use_data(keydefs, overwrite = TRUE, internal = TRUE)


tibble::enframe(keydef) |>
unnest_wider(value) |>
tidyr::unnest_wider(value) |>
dplyr::arrange(keyCode) |>
View()

0 comments on commit 80a34c2

Please sign in to comment.