forge
Explore
Log in

Don't you dare go Hollow

yumush

Clone
★ 0

0 watching0 forksRustAGPL-3.010.6 MiB02871e1Tahinli35 minutes ago415 commits

keys.rs21 lines, 376 bytesHistoryRawDownload
1const MOD_LABEL: &str = if cfg!(target_os = "macos") {
2 "Cmd"
3} else {
4 "Ctrl"
5};
6
7macro_rules! bind {
8 ($keys:literal) => {
9 if cfg!(target_os = "macos") {
10 concat!("cmd-", $keys)
11 } else {
12 concat!("ctrl-", $keys)
13 }
14 };
15}
16
17pub(crate) use bind;
18
19pub fn label(keys: &str) -> String {
20 format!("{MOD_LABEL}+{keys}")
21}