summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/menukeys/menukeys.dtx
blob: 0d65a027b99fc8e9b191a0f0b90f69c3a84ce33a (plain)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
% \iffalse meta-comment
%
%% File: menukeys.dtx Copyright (c) Tobias Weh
%%
%% This file may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%<package>\NeedsTeXFormat{LaTeX2e}[2009/01/01]
%<package>\ProvidesPackage{menukeys}
%<package>  [2020/10/31 v1.6 -- A package to format menus, paths and shortcuts]
%
%<*driver>
\documentclass{ltxdoc}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{menukeys}
\usepackage{xspace}
\usepackage[hang]{footmisc}
\usepackage{dblfnote}
\setlength{\footnotemargin}{1em}
\usepackage{listings}
\usepackage{xcolor}
\definecolor{darkred}{HTML}{770011}
\definecolor{darkblue}{HTML}{003b8b}
\PassOptionsToPackage{%
   linkcolor=darkblue,
   urlcolor=darkred,
   bookmarksopen=true,
   bookmarksdepth=10,
}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\usepackage{hypdoc}


\renewcommand{\usage}[1]{\textbf{\hyperpage{#1}}}
\renewcommand{\main}[1]{\textit{#1}}

\newcommand{\menukeys}{\texttt{menukeys}\xspace}
\newcommand{\TikZ}{Ti\textit{k}Z\xspace}

\newcommand*{\pkg}[1]{\texttt{#1}}
\newcommand*{\env}[1]{\texttt{#1}}
\newcommand*{\fnt}[1]{\texttt{#1}}
\newcommand*{\opt}[1]{\texttt{#1}}
\newcommand{\DO}[1]{%
   \marginpar{\raggedleft\texttt{#1} \footnotesize(opt.)}%
   \index{#1=\texttt{#1}  (option)|usage}%
   \index{Options:>\texttt{#1}|usage}%
   \ignorespaces
}
\newcommand{\DM}[1]{\DescribeMacro{#1}\ignorespaces}
\newcommand{\DE}[1]{\DescribeEnv{#1}\ignorespaces}
\newcommand{\AST}{\meta{\texttt{*}}}

\newcommand{\minisec}[1]{\par\medskip\noindent{\sffamily\bfseries#1}\quad}
\newcommand{\example}{\minisec{Example}\xspace}

\providemenumacro{\test}{roundedmenus}
\NewDocumentCommand{\teststyle}{ o m m m }{{%
   \renewmenumacro{\test}{#2}%
   \par\vspace{1.5\baselineskip plus 0.5\baselineskip minus 0.25\baselineskip}
   \noindent
   \fbox{\begin{minipage}{0.97\textwidth}
   Name: \texttt{#2}
      \index{#2=\texttt{#2}  (style)|usage}%
      \index{Styles:>\texttt{#2}|usage}
   \par\vspace{0.5\baselineskip}%
   \test{#3}
   \par\vspace{0.5\baselineskip}%
   \test{#4}%
   \par\vspace{0.5\baselineskip}%
   This is some more or less blind text, to demonstrate how
   the sequence looks in text. This \test{#3} is the result
   of a style which name is \texttt{#2}. And again some
   blind text without any sense.%
   \IfValueT{#1}{{%
      \par\vspace{0.5\baselineskip}%
      \itshape\footnotesize#1\par
   }}%
   \end{minipage}}%
}}
\makeatletter
\newcommand{\colortest}[1]{{%
   \par\vspace{\baselineskip}%
   \setlength{\fboxsep}{0pt}%
   \noindent Name: \texttt{#1}\index{#1=\texttt{#1}  (theme)|usage}%
   \index{Color themes:>\texttt{#1}|usage}
   \\[0.5\baselineskip]
   Background: \fbox{\textcolor{tw@color@theme@#1@bg}{\rule[-0.4ex]{2.2ex}{2.2ex}}}
   \quad Border: \fbox{\textcolor{tw@color@theme@#1@br}{\rule[-0.4ex]{2.2ex}{2.2ex}}}
   \quad Text: \fbox{\textcolor{tw@color@theme@#1@txt}{\rule[-0.4ex]{2.2ex}{2.2ex}}}
   \quad (A: \fbox{\textcolor{tw@color@theme@#1@a}{\rule[-0.4ex]{2.2ex}{2.2ex}}}
   \quad B: \fbox{\textcolor{tw@color@theme@#1@b}{\rule[-0.4ex]{2.2ex}{2.2ex}}}
   \quad C: \fbox{\textcolor{tw@color@theme@#1@c}{\rule[-0.4ex]{2.2ex}{2.2ex}}}\kern2pt)
}}
\makeatother

\MakeShortVerb{\|}

\setcounter{tocdepth}{3}

\makeatletter
\def\SpecialMainEnvIndex#1{\@bsphack\special@index{%
                                      #1\actualchar
                                      {\string\ttfamily\space#1}
                                         (env)%
                                      \encapchar main}%
    \special@index{Environments:\levelchar#1\actualchar{%
                   \string\ttfamily\space#1}\encapchar
           main}\@esphack}
\def\SpecialUsageIndex#1{\@bsphack
   {\let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}%
   \@esphack}
\def\SpecialEnvIndex#1{\@bsphack
    \index{#1\actualchar{\protect\ttfamily#1}
           (env)\encapchar usage}%
    \index{Environments:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
           usage}\@esphack}
\makeatother

\addto\captionsenglish{%
   \def\indexname{Macro index}
   \def\glossaryname{Change history}
}
\IndexPrologue{
  \section{Macro index}
  Numbers written in bold face refer to the page where the corresponding entry is described;
  italic numbers refer to the code line of the definition; numbers in roman refer to the code
  lines where the entry is used.
}
\GlossaryPrologue{
  \section{Change history}\label{version}%
}

\setcounter{IndexColumns}{2}

\makeatletter
\tikzset{tw@menusbig@base/.style={%
   tw@set@tikz@colors,
   rounded corners=0.15ex,
   inner sep=0pt,
   inner xsep=2pt,
   text height=2.1ex,
   text depth=0.6ex,
   minimum width=1.5em,
   font=\Huge\bfseries\sffamily,
   signal,
   signal to=nowhere,
   signal pointer angle=110,
   ultra thick,
}}
\tw@declare@style*{menusbig}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menusbig@base,signal to=east]%
      {\strut\CurrentMenuElement};}%
}[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]%
{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menusbig@base,signal from=west,signal to=east]%
      {\strut\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menusbig@base,signal from=west,]%
      {\strut\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menusbig@base]{\strut\CurrentMenuElement};}%
}{blacknwhite}
\newmenumacro{\filefolder}[/]{pathswithblackfolder}
\newmenumacro{\MENU}[,]{menusbig}
\makeatother

\EnableCrossrefs
\CodelineIndex
\RecordChanges

\begin{document}
  \DocInput{menukeys.dtx}
\end{document}
%</driver>
% \fi
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v1.0}{2012/02/23}{Initial version}
% \changes{v1.1}{2012/02/26}{Improved manual}
% \changes{v1.2}{2013/07/23}{Tidy up version and date}
% \changes{v1.2}{2013/07/23}{Fixed GitHub issues \#9, \#10, \#11, \#13, \#17, \#24 and \#26}
% \changes{v1.2}{2013/07/23}{Added \cs{SPACE} and \cs{spacename}}
% \changes{v1.2}{2013/07/23}{Added \cs{normalsize} before symbol definitions to make
%                            the \texttt{ex} unit available}
% \changes{v1.2a}{2013/09/10}{Replaced obsolete \cs{tikzsytle}}
% \changes{v1.2a}{2013/09/10}{Added braces to the \cs{tikz} macro since the parser
%                             seems to crash with \pkg{babel}'s french option otherwise.}
% \changes{v1.3}{2014/03/10}{Improved key symbols.}
% \changes{v1.3}{2014/03/10}{Added \TikZ-styles for the key symbols.}
% \changes{v1.4}{2016/04/17}{The \texttt{path...} styles now use the text color
%                            of the selected color theme (fix issue \#16).}
% \changes{v1.4}{2016/04/18}{Extended color theme features.}
%
% \GetFileInfo{menukeys.sty}
%
% \DoNotIndex{\?,\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
% \DoNotIndex{\@badmath,\@centercr,\@cite}
% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
% \DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
% \DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint}
% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
% \DoNotIndex{\@xxpt,\@xxvpt,\\,\,\addpenalty,\addtolength,\addvspace}
% \DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
% \DoNotIndex{\bullet}
% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
% \DoNotIndex{\fbox}
% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
% \DoNotIndex{\input}
% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
% \DoNotIndex{\NeedsTeXFormat,\newdimen}
% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
% \DoNotIndex{\refstepcounter,\relax,\renewcommand}
% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
% \DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength}
% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
% \DoNotIndex{\wd,\xiipt,\year,\z@}
% \expandafter\DoNotIndex{\,}
% \DoNotIndex{\next,\unexpanded,\@backslashchar,
%   \@ifundefinedcolor,\@nameuse,\detokenize,
%   \cslet,\csname,\edef,\endcsname,
%   \NewDocumentCommand}
% \DoNotIndex{\@afterheading,\@afterindentfalse,\@ifpackageloaded,\ ,
%   \appto,\AtBeginDocument,\AtEndPreamble,\baselineskip,\BODY,
%   \centering,\contentspage,\CurrentOption,\dots,\endquote,\fill,\filright,
%   \tiny,\footnotesize,\Huge,\ifstrempty,\ifstrequal,\itshape,\Large,\large,\LARGE,
%   \makebox,\MessageBreak,\NewEnviron,\newif,\normalfont,\normalsize,
%   \pbox,\preto,\quote,\RequirePackage,\rule,\setstretch,
%   \SetupKeyvalOptions,\sffamily,\singlespacing,\textbf,\textit,\textwidth,
%   \thecontentslabel,\thecontentspage,\titlecontents,\xspace}
% \DoNotIndex{\0,\1,\2,\3,\4,\5,\6,\7,\8,\9,0,1,2,3,4,5,6,7,8,9}
% \DoNotIndex{\lccode,\listof,\lowercase,\PackageWarningNoLine,\PackageError,
%   \PackageWarning,\renewenvironment,\romannumeral,\string,\strut}
% \DoNotIndex{\csdef,\cslet\csletcs,\letcs,\DeclareDocumentCommand,\ifcsundef,
%   \RenewDocumentCommand,\ProvideDocumentCommand,\NewDocumentCommand,\hspace,
%   \IfBooleanTF,\IfSubStr}
% \DoNotIndex{\tikz,\node,\draw,\definecolor,\colorlet,\usetikzlibrary,
%   \texttt,\textcolor,\raisebox,\maxsizebox,\small,\ttfamily,\DeclareBoolOption}
% \DoNotIndex{\value,\usebox,\sbox,\providecommand,\ProcessKeyvalOptions,\newbox,
%   \IfStrEq,\hyphenchar,\expandonce,\encodingdefault,\DeclareStringOption}
%
% \title{\Huge\MENU[,]{M,E,N,U,K,E,Y,S}}
% \author{Tobias Weh\\
%   \normalsize\href{mailto:mail@tobiw.de}{\texttt{mail@tobiw.de}}\\
%   \normalsize\url{http://tobiw.de/en}\\
%   \normalsize\url{http://github.com/tweh/menukeys}\\
%   \normalsize\url{http://www.ctan.org/pkg/menukeys}\\
%   \normalsize\filefolder{macros/latex/contrib/menukeys}}
% \date{\filedate{} --- \fileversion}
% \thispagestyle{empty}
% \maketitle
% 
% \begin{abstract}
%    \noindent
%    This package is build to format menu sequences, paths and keystrokes.
%    \par\medskip\noindent
%    You're welcome to send me feedback, questions, bug reports and feature requests.
%    If you like to support this package -- especially improving or proofreading the
%    manual -- send me an e-mail, please.
%    \par\bigskip\noindent
%    \emph{Many thanks to Ahmed Musa, who provided the original list parsing
%    code at \url{http://tex.stackexchange.com/a/44989/4918}.}
%    \par\bigskip\noindent
%    \emph{Special thanks to Jonathan P.\@ Spratte, who made the changes in v1.6
%    to remove the \pkg{catoptions} dependency so that \pkg{menukeys} works with
%    \LaTeX\ releases starting from 2020/10/01.}
%   \end{abstract}
% 
% \newpage\tableofcontents\newpage
%
% \section{Introduction}\label{intro}
% The \menukeys package is mainly designed to parse and print
% sequences of software menus, folders and files or keystrokes.
% The most predefined styles use the power of \TikZ\footnote{See
% \url{http://www.ctan.org/pkg/pgf}.} to format the output.
% 
% For example if you want to tell the reader of a manual how to set the ruler
% unit you may type
% \begin{verbatim}
%    To set the unit of the rulers go to \menu{Extras > Settings > Rulers}
%    and choose between millimeters, inches and pixels. The shortcut
%    to view the rulers is \keys{cmd + R}. Pressing these keys again
%    will hide the rulers.
%    
%    The standard path for saving your document is \directory{Macintosh HD/Users/
%    Your Name/Documents} but you can change it at \menu{Extras > Settings
%    > Saving} by clicking \menu{Change save path}.
% \end{verbatim}
% and get this:
% 
% \medskip
%    To set the unit of the rulers go to \menu{Extras > Settings > Rulers}
%    and choose between millimeters, inches and pixels. The shortcut
%    to view the rulers is \keys{cmd + R}. Pressing these keys again
%    will hide the rulers.
%    
%    The standard path for saving your document is \directory{Macintosh HD/Users/
%    Your Name/Documents} but you can change it at \menu{Extras > Settings
%    > Saving} by clicking \menu{Change save path}.
% 
% \bigskip\noindent
% The package is loaded as usual via
% \begin{verbatim}
%    \usepackage{menukeys}
% \end{verbatim}
% 
% \section{Installation}
% To install \menukeys manually run
% \begin{verbatim}
%    latex menukeys.ins
% \end{verbatim}
% and copy |menukeys.sty| to a path where \LaTeX{} can find it.
% 
% To typeset this manual run
% \begin{verbatim}
%    pdflatex menukeys.dtx
%    makeindex -s gglo.ist -o menukeys.gls menukeys.glo
%    makeindex -s gind.ist -o menukeys.ind menukeys.idx
%    pdflatex menukeys.dtx
%    pdflatex menukeys.dtx
% \end{verbatim}
%
% \section{Package loading and options}\label{options}
% \changes{v1.6}{2020/10/27}{Load order no longer important}
% Since \menukeys used to use \pkg{catoptions}, which does some heavy changes on key-value
% options, it \textbf{was} recommended to load \menukeys as the last package
% (even after \pkg{hyperref}\footnote{See \url{http://tex.stackexchange.com/q/237683/4918}
% and \url{https://github.com/tweh/menukeys/issues/41}.}).
% \textbf{This is no longer the case!}
% 
% These are the possible options:
% \begin{description}
%    \item [definemenumacros:] Most of \menukeys' macros should not
%       conflict with other packages\footnote{If you find a conflict send an e-mail.}
%       but the predefined menu macros should be short and easy-to-read
%       commands, which means that |\menu{A,B,C}| is preferred against
%       |\printmenusequence{A,B,C}|. For that it's not unlikely that they
%       conflict with other packages. To prevent this you can tell
%       \menukeys to not define them by calling the option \DO{definemenumacros}
%       |definemenumacros=false|. The default value is |true|.
%       
%       If you do so you have to define your own menu macros, see section~\ref{menumacros}
%       for details.
%    \item [definekeys:] Equal to |definemenumacros|  \DO{definekeys}  for the key macros.
%       The default value is |true|.
%    \item [mackeys:] This option \DO{mackeys} allows you to decide whether the mac keys
%       are shown as text (|mackeys=text|) or symbols  (|mackeys=symbols|). The default
%       value is |symbols|.
%    \item [os:] You can specify the OS \DO{os} by saying |os=mac| or |os=win|. This will cause
%       some key macros to be rendered differently. The default value is |mac|.
%    \item [hyperrefcolorlinks:] \emph{Obsolete}
%       (see sec.~\ref{sec:issues} and~\ref{sec:hyperref-colorlinks}).
% \end{description}
% 
% \section{Usage}
% \subsection{Basics}\label{basics}
% \menukeys comes with three ``menu macros'' that parse and print lists. We have
% \DM{\menu}|\menu|\marg{menu sequence}, with |>| as default input list separator,
% \DM{\directory}|\directory|\marg{path and files} with |/| as default separator and
% \DM{\keys}|\keys|\marg{keystrokes} with |+| as default separator. You've seen
% examples for all of them in section~\ref{intro}.
% 
% These macros have also an optional argument to set the input list separator.
% E.g. if you want to put in your menus with |,| instead of |>| you can say
% |\menu[,]|\marg{menu sequence}.\footnote{If you want to change the input separator
%  globally it's recommended to renew the menu macro as described in section~\ref{menumacros}.}
% 
% The possible input separators are |/|, |=|, |*|, |+|, |,|, |;|, |:|, |-|, |>|,
% |<| and |bslash| (to use |\| as separator).  You can hide a separator from the
% parser by putting a part of the sequence in braces. Spaces around the separator
% will be ignored, i.e. |\keys{\ctrl+C}| equals |\keys{\ctrl + C}|.
% \example |\menu[,]{Extras,Settings,{Units, rulers and origin}}| gives 
% \menu[,]{Extras,Settings,{Units, rulers and origin}}
%
% \subsection{Styles}
% \menukeys defines several ``styles'' that determine the output format
% of a menu macro. There are some predefined styles and others can be
% created by the user.
% \subsubsection{Predefined styles}
% 
% \teststyle{menus}{File,Extras,Preferences}{Menu}
% \teststyle{roundedmenus}{File,Extras,Preferences}{Menu}
% \teststyle{angularmenus}{File,Extras,Preferences}{Menu}
% \teststyle[The color of + is taken from optional color B.]
%    {roundedkeys}{Ctrl,Alt,Q}{S}
% \teststyle[The color of + is taken from optional color B.\\
%    The shadow color is taken from optional color C.]
%    {shadowedroundedkeys}{Ctrl,Alt,Q}{S}
% \teststyle[The color of + is taken from optional color B.]
%    {angularkeys}{Ctrl,Alt,Q}{S}
% \teststyle[The color of + is taken from optional color B.\\
%    The shadow color is taken from optional color C.]
%    {shadowedangularkeys}{Ctrl,Alt,Q}{S}
% \teststyle[The color of + is taken from optional color B.]
%    {typewriterkeys}{Alt,Q}{S}
% \teststyle[The sep color is taken from optional color C.]
%    {paths}{C:,User,Folder,MyFile.tex}{MyFile.tex}
% \teststyle[%
%    The folder draw color is taken from optional color B.\\
%    The folder fill color is taken from optional color A.\\
%    The sep color is taken from optional color C.%
%    ]
%    {pathswithfolder}{C:,User,Folder,MyFile.tex}{MyFile.tex}
% \teststyle[%
%    The folder draw color is taken from optional color B.\\
%    The folder fill color is taken from optional color C.\\
%    The sep color is taken from optional color C.%
%    ]
%    {pathswithblackfolder}{C:,User,Folder,MyFile.tex}{MyFile.tex}
% 
% \bigskip\noindent
% The following three styles allow paths elements to be hyphenated, but
% they insert only a line break without a hyphen dash. Note that they only
% work with |T1| and |OT1| encoding (at least I tested only these ones)
% and that this in some cases doesn't work very well.
% \teststyle[The sep color is taken from optional color C.]
%    {hyphenatepaths}{C:,Database,User,ALongUserNameHere,%
%    ALongerFolderNameAtThisPlace,MyFile.tex}{MyFile.tex}
% \teststyle[%
%    The folder draw color is taken from optional color B.\\
%    The folder fill color is taken from optional color A.\\
%    The sep color is taken from optional color C.%
%    ]
%    {hyphenatepathswithfolder}{C:,Database,User,ALongUserNameHere,%
%    ALongerFolderNameAtThisPlace,MyFile.tex}{MyFile.tex}
% \teststyle[%
%    The folder draw color is taken from optional color B.\\
%    The folder fill color is taken from optional color C.\\
%    The sep color is taken from optional color C.%
%    ]
%    {hyphenatepathswithblackfolder}{C:,Database,User,ALongUserNameHere,%
%    ALongerFolderNameAtThisPlace,MyFile.tex}{MyFile.tex}
%
% \bigskip\pagebreak
% \minisec{Hint} The folder is drawn with the command \DM{\drawtikzfolder}
% |\drawtikzfolder| which is part of \menukeys and has two optional arguments
% to change the color of the lines and the fill color of the front:\\
% |\drawtikzfolder|\oarg{front fill}\oarg{draw}
% 
% \subsubsection{Declaring styles}
% The simplest way to define a new style is to use \DM{\newmenustylesimple}
% |\newmenustylesimple|. It has six arguments: |\newmenustylesimple|\AST%
% \marg{name}\oarg{pre}\marg{style}\oarg{sep}\oarg{post}\linebreak \marg{theme}
% \begin{description}
%    \item [name] is the name of the new style. It must follow the
%       specifications of \TeX{} control sequences, which means it must
%       contain only letters and no numbers.
%    \item [pre] is the code which is executed before a menu macro.
%    \item [style] is the style for the first list element. It has to be
%       a \TikZ-style which is applied to a |node|, e.g. |draw,blue|.
%    \item [sep] is the code executed between the lists elements, e.g. some
%       space or a symbol.
%    \item [post] is the code which is executed after a menu macro.
%    \item [theme] is a color theme (see section~\ref{colors}).
% \end{description}
% \example Let us consider we want a list that prints a frame around its
% elements and separates them by a star. We can use
% \begin{verbatim}
%    \newmenustylesimple{mystyle}{draw}[$\ast$]{mycolors}
% \end{verbatim}
% 
% The more advanced command is \DM{\newmenustyle}|\newmenustyle|. It has
% nine arguments: |\newmenustyle|\AST\marg{name}\oarg{pre}\marg{first}%
% \oarg{sep}\marg{mid}\marg{last}\marg{single}\newline\oarg{post}\marg{theme}
% \begin{description}
%    \item [name] is the name of the new style. It must follow the
%       specifications of \TeX{} control sequences, which means it must
%       contain only letters and no numbers.
%    \item [pre] is the code which is executed before a menu macro.
%    \item [first] is the style for the first list element. It has to be
%       a \TikZ-style which is applied to a |node|, e.g. |draw,blue|.
%    \item [sep] is the code executed between the lists elements, e.g. some
%       space or a symbol.
%    \item [mid] is the style for all elements between the first and the
%       last one. It has to be a \TikZ sytle.
%    \item [last] is the style for the last list element.
%       It has to be a \TikZ sytle.
%    \item [single] this style is used if the list contains only one element.
%       It has to be a \TikZ sytle.
%    \item [post] is the code which is executed after a menu macro.
%    \item [theme] is a color theme (see section~\ref{colors}).
% \end{description}
% \example We can extend the previous example and desire that the first and
% the last element became red, and a single element should have a dashed frame. Furthermore
% the menu sequence should be preceded  and followed by a bullet point:
% \begin{verbatim}
%    \newmenustyle{mystyle}[$\bullet$]{draw,red}[$\ast$]%
%       {draw}{draw,red}{draw,dashed}[$\bullet$]
% \end{verbatim}
% 
% If the \TikZ |node| system doesn't fit your needs there are the \textbf{starred versions}:
% Use them and the arguments \meta{first}, 
% \meta{mid}, \meta{last}, \meta{single} can be any \LaTeX{} code. To access the
% current list element use \DM{\CurrentMenuElement}|\CurrentMenuElement|.
% \example consider that we want all menu elements simple be fat and not
% drawn with a \TikZ |node|. The separator should be the star again:
% \begin{verbatim}
%    \newmenustylesimple*{mystyle}{\textbf{\CurrentMenuElement}}[$\ast$]
% \end{verbatim}
%
% If you want to make your own style you must take care of using the color
% theme. \DM{\usemenucolor} To access a color of the currently applied
% theme while defining a style use |\usemenucolor|\marg{element} (See 
% section~\ref{colors} for details about possible elements).
% 
% \subsubsection{Copying styles}
% To copy an existing style to a new style use \DM{\copymenustyle}|\copymenustyle|%
% \marg{copy}\marg{original}.
% \example To copy the definition of |mystyle| to |mycopy| use
% \begin{verbatim}
%    \copymenustyle{mycopy}{mystyle}
% \end{verbatim}
% 
% \subsubsection{Changing styles}
% The simplest change we can imagine is to change a single element or the color theme of
% an existing style. For the first case there is \DM{\changemenuelement}
% |\changemenuelement|\AST\marg{name} \marg{element}\marg{definition}, where the starred
% version works like the one of |\newmenustyle| does.
% \example To change the single element of |mystyle| from dashed to solid use the
% following code. You may save the original style by copying it as described above.
% \begin{verbatim}
%    \changemenuelement{mystyle}{single}{draw}
% \end{verbatim}
% \DM{\changemenucolortheme}To satisfy the second case use |\changemenucolortheme|%
% \marg{name}\marg{color theme}.
% \example To change the color theme of |mystyle| to |myothercolors| call
% \begin{verbatim}
%    \changemenucolortheme{mystyle}{myothercolors}
% \end{verbatim}
% 
% \DM{\renewmenustylesimple}\DM{\providemenustylesimple}\DM{\renewmenustyle}%
% \DM{\providemenustyle} The next level is redefining a style. This package provides
% the following  macros the work like their \LaTeX-paragons and have the same
% arguments as the above described macros: |\renewmenustylesimple|,
% |\providemenustylesimple|, |\renewmenustyle| and |\providemenustyle|.
%
% \subsection{Color themes}\label{colors}%
% To make the colors of a style become changeable without
% touching the style itself, \menukeys uses ``color themes''. Every color theme
% must contain three color definitions that can be used to draw a |node| 
% background, a |node| frame and a text color, and additionally two optional
% colors used by some themes.
% \subsubsection{Predefined themes}
% There are two predefined color themes
% \colortest{gray}\colortest{blacknwhite}
% \subsubsection{Create a theme}
% \DM{\newmenucolortheme}To create a new theme use |\newmenucolortheme|. It uses the
% following arguments:\\
% |\newmenucolortheme|\marg{name}\marg{model}\marg{bg}\marg{br}\marg{txt}\oarg{a}\oarg{b}\oarg{c}
% \begin{description}
%    \item [name] is the name of the theme and must contain only letters.
%    \item [model] is the \pkg{xcolor} color model which is used to define a color, e.g.
%       |named|, |rgb|, |cmyk|, \dots
%    \item [bg] is the color definition for the |node| background.
%    \item [br] is the color definition for the |node| border.
%    \item [txt] is the color definition for the |node|'s text.
%    \item [a] is an optional additional color (by default same as bg).
%    \item [b] is an optional additional color (by default same as br).
%    \item [c] is an optional additional color (by default same as txt).
% \end{description}
% \example To create a theme called |mycolors| we can say
% \begin{verbatim}
%    \newmenucolortheme{mycolors}{named}{red}{green}{blue}
% \end{verbatim}
% \subsubsection{Copy a theme}
% \DM{\copymenucolortheme}To copy the definitions of one theme to another,
% use |\copymenucolortheme| \marg{copy}\marg{original}.
% \example To copy the colors of |mycolors| to |copycolors| type
% \begin{verbatim}
%    \copymenucolortheme{copycolors}{mycolors}
% \end{verbatim}
% \subsubsection{Change a theme}
% \DM{\changemenucolor} If you want to change the color of a theme's element
% use |\changemenucolor|\marg{name} \marg{element}\marg{model}\marg{color definition},
% where name is the theme's name and \meta{element} is |bg|, |br|, or |txt|.
% \example Let's change the text color of |mycolors|:
% \begin{verbatim}
%    \changemenucolor{mycolors}{txt}{named}{gray}
% \end{verbatim}
% 
% \DM{\renewmenucolortheme}To redefine a complete theme use |\renewmenucolortheme|.
% It works with the same arguments as |\newmenucolortheme|.
%
% \subsection{Menu macros}\label{menumacros}%
% The ``menu marcos'' take a list separated by a special symbol to
% print it with a menu style.
% \subsubsection{Predefined menu macros}
% See section~\ref{basics}.
% \subsubsection{Defining or changing menu macros}
% \DM{\newmenumacro}To define a new menu macro call |\newmenumacro|\marg{macro}%
% \oarg{input sep}\marg{style}.
% \begin{description}
%    \item [name] is a \LaTeX{} control sequence name.
%    \item [input sep] is the default separator used in the input list 
%       (see section~\ref{basics} for a list of valid separators).
%    
%       If you don't give it the package's default (|,|) is used.
%    \item [style] is a menu style.
% \end{description}
% This wil give you a macro like |\|\meta{macro}\oarg{input sep}\marg{list}
% \example Assuming you need a command to format Windows paths, you can
% define it with
% \begin{verbatim}
%    \newmenumacro{\winpath}[bslash]{mystyle}
% \end{verbatim}
% and then use it as e.g. |\winpath{C:\System\Deep\Deeper\YourFile.txt}|.
% Note that |mystyle| must be defined before you call |\newmenumacro|.
% 
% \DM{\providemenumacro}\DM{\renewmenumacro}There are also the two commands
% |\providemenumacro| and |\renewmenumacro| which take the same arguments as
% |\newmenumacro| and work like the \LaTeX{} macros |\renewcommand| and |\providecommand|.
% \example To change the default input separator of |\menu| you must know
% the default style (which is |menus|) and then you can say
% \begin{verbatim}
%    \renewmenumacro{\menu}[,]{menus}
% \end{verbatim}
%
% \subsection{Keys}
% The \menukeys package comes with some macros to print
% special keys in the sequences set with |\keys|. Depending on
% the given OS (see section~\ref{options}) some macros behave
% differently to be able to use a key even if it's undefined
% via the \opt{os} option macros like |\|\meta{key}|mac| and
% |\|\meta{key}|win| that will always give the right symbol.
%
% The full ist of key macros is shown in table~\ref{tab:keys}.
%
% \begin{table}[ht]
%  \caption{Overview of all key macros.}\label{tab:keys}
%  \small
%  \renewcommand{\arraystretch}{1.25}
%  \begin{minipage}[t]{0.45\textwidth}
%  \begin{tabular}[t]{lll}
%     \hline
%     \textbf{Macro} & \textbf{Mac} & \textbf{Win.} \\
%     \hline
%     |\shift| & \shift & \shift\\
%     |\capslock| & \capslockmac & \capslockwin\\
%     |\tab| & \tabmac & \tabwin\\
%     |\esc| & esc / \escmac  & \escwin\\
%     |\oldesc| & esc / \oldescmac  & \oldescwin\\
%     |\ctrl| & \ctrlmac & \ctrlwin{}\\
%     |\Alt| & alt / \Altmac & \Altwin \\
%     |\AltGr| & & \AltGr \\
%     |\cmd|   & cmd / \cmdmac & \\
%     |\Space| & [empty sp.] & [empty sp.] \\
%     |\SPACE| & \spacename & \spacename \\
%     |\return| & \returnmac & \returnwin \\
%     |\enter| & \entermac & \enterwin \\
%     \hline
%  \end{tabular}
%  \end{minipage}\hfill
%  \begin{minipage}[t]{0.45\textwidth}
%  \begin{tabular}[t]{lll}
%     \hline
%     \textbf{Macro} & \textbf{Mac} & \textbf{Win.} \\
%     \hline
%     |\winmenu| & & \winmenuwin \\
%     |\backspace| & \backspace & \backspace\\
%     |\del| & Del. / \delmac & \delwin{}\\
%     |\backdel| & Del. / \backdelmac & \backdelwin{}\\
%     |\arrowkey{^}| & \arrowkey{^} & \arrowkey{^} \\
%     |\arrowkeyup| & \arrowkeyup & \arrowkeyup\\
%     |\arrowkey{v}| & \arrowkey{v} & \arrowkey{v} \\
%     |\arrowkeydown| & \arrowkeydown & \arrowkeydown\\
%     |\arrowkey{>}| & \arrowkey{>} & \arrowkey{>} \\
%     |\arrowkeyright| & \arrowkeyright & \arrowkeyright\\
%     |\arrowkey{<}| & \arrowkey{<} & \arrowkey{<} \\
%     |\arrowkeyleft| & \arrowkeyleft & \arrowkeyleft\\
%     \hline
%  \end{tabular}
%  \end{minipage}
% \end{table}
%
% \DM{\arrowkey}
% The macro |\arrowkey|\marg{direction} is a little special
% since it takes the direction as a singe character |^|, |v|
% (lower case v), |>| or |<|.
% 
% \DM{\ctrlname}\DM{\delname}\DM{\spacename}The texts for |\ctrl|, 
% |\del| and |\SPACE| are saved in |\ctrlname|, |\delname|, |\spacename| respectively.
% So you can change them with |\renewcommand|.
% 
% The rendering of some Mac macros depend on the option \DO{mackeys}\opt{mackeys}
% The different versions are shown in the table (left: |text|, right: |symbols|).
%
% \bigskip\noindent
% I apologize that there are no commands for the windows key
% and the apple logo, but that would be a copyright infringement.
% 
% \section{Known issues and bugs}\label{sec:issues}
% \begin{itemize}
%    \item If you use the \pkg{inputenc} package \menukeys must be
%       loaded after it. Otherwise some key macros get corrupted.
%    \item \changes{v1.1}{2012/02/26}{Load \pkg{xcolor} before \menukeys.}
%       \menukeys must be loaded after \pkg{xcolor}, if you load
%       the latter with options. Otherwise you'll get an option clash
%       Since \menukeys loads \pkg{xcolor} internally you may pass
%       options as global options via |\documentclass| or directly to it via
%       |\PassOptionsToPackage|.
%       \example Set \pkg{xcolor} to |cmyk| model:
%       \begin{verbatim}
%    \documentclass{article}
%    \PassOptionsToPackage{cmyk}{xcolor}
%    \usepackage{menukeys}
%    \begin{document}
%       Hello World!
%    \end{document}
%    \end{verbatim}
% \end{itemize}
%
% If you find something to add to this list please send me an e-mail or report a
% bug on GitHub (\url{https://github.com/tweh/menukeys}).
%
% \StopEventually{\clearpage\PrintChanges\PrintIndex}
%
% \section{Implementation}
% \subsection{Required packages}
% \changes{v1.6}{2020/10/27}{Don't load \pkg{catoptions}}
% Load the required packages
%    \begin{macrocode}
\RequirePackage{xparse}
\RequirePackage{xstring}
\RequirePackage{etoolbox}
%    \end{macrocode}
% Furthermore we need \TikZ and some of its libraries,
%    \begin{macrocode}
\RequirePackage{tikz}
   \usetikzlibrary{calc,shapes.symbols,shadows}
%    \end{macrocode}
% the color package \pkg{xcolor} and \pkg{adjustbox} for the
% |typewriterkeys| style.
%    \begin{macrocode}
\RequirePackage{xcolor}
\RequirePackage{adjustbox}
%    \end{macrocode}
% Load \pkg{relsize} to be able to change the font size
% relative to the surrounding text.
%    \begin{macrocode}
\RequirePackage{relsize}
%    \end{macrocode}
% To define the list parsing commands and allow |\| as
% a separator we used to load \pkg{catoptions}. Instead we now use some
% \pkg{expl3} functions to replace the macros we required from \pkg{catoptions}.
%
% The first few of these functions are more or less direct equivalents. A bit of
% attention has to be paid for |\tw@mk@xifinsetTF| as it requires the arguments
% to get swapped.
%    \begin{macrocode}
\ExplSyntaxOn
\cs_new_eq:NN \tw@mk@trimspaces \tl_trim_spaces:n
\cs_new_eq:NN \tw@mk@expanded \use:x
\prg_generate_conditional_variant:Nnn \tl_if_in:nn { xx } { TF }
\cs_new:Npn \tw@mk@xifinsetTF #1 #2
  {
    \tl_if_in:xxTF {#2} {#1}
  }
%    \end{macrocode}
% The replacement for |\indrisloop| will not set the conditional
% |\iflastindris|, instead we can check whether the sequence is empty to see
% whether this is the last element. This test will not use a TeX-like
% |\iflastindris...\else...\fi| construct but instead two branches.
%    \begin{macrocode}
\cs_new:Npn \tw@mk@iflastindris
  {
    \seq_if_empty:NTF \l__twmk_indris_seq
  }
%    \end{macrocode}
% Replacing |\indrisloop| is a bit more work as it requires us to push some
% values to a stack (to allow nested usage, this may not be necessary for
% \pkg{menukeys}, but it is part of the original |\indrisloop| so we should
% play nice here). First we'll need a few variables.
%    \begin{macrocode}
\seq_new:N \l__twmk_indris_seq
\int_new:N \l__twmk_indris_int
\tl_new:N  \l__twmk_indris_tl
\cs_new_eq:NN \tw@mk@indrisnr \l__twmk_indris_int
\seq_new:N \l__twmk_indris_seqstack_seq
\seq_new:N \l__twmk_indris_intstack_seq
%    \end{macrocode}
% Our stack will use another sequence in which the definitions of the parent
% call will be stored for the sequence and the integer. The other variables put
% on a stack by |\indrisloop| aren't required. The synopsis of
% |\tw@mk@indrisloop| will be different to the one provided by \pkg{catoptions}.
% The delimiter will be a mandatory argument (not in brackets), and there is no
% starred version.
%    \begin{macrocode}
\cs_new_protected:Npn \__twmk_pushseq:
  {
    \seq_push:No \l__twmk_indris_seqstack_seq \l__twmk_indris_seq
  }
\cs_new_protected:Npn \__twmk_pushint:
  {
    \seq_push:NV \l__twmk_indris_intstack_seq \l__twmk_indris_int
  }
\cs_new_protected:Npn \__twmk_popseq:
  {
    \seq_if_empty:NTF \l__twmk_indris_seqstack_seq
      { \seq_clear:N \l__twmk_indris_seq }
      { \seq_pop:NN \l__twmk_indris_seqstack_seq \l__twmk_indris_seq }
  }
\cs_new_protected:Npn \__twmk_popint:
  {
    \seq_if_empty:NTF \l__twmk_indris_intstack_seq
      { \int_zero:N \l__twmk_indris_int }
      {
        \group_begin:
          \seq_pop:NN \l__twmk_indris_intstack_seq \l__twmk_indris_tl
          \exp_args:NNNo
        \group_end:
        \int_set:Nn \l__twmk_indris_int \l__twmk_indris_tl
      }
  }
%    \end{macrocode}
% The real loop works by first splitting the input into a sequence according to
% the delimiter in |#1|. Then this sequence is stepped through, but instead of
% using |\seq_map:NN| we'll have to pop the sequence into a local variable so
% that our test for the last element works. The parameter |#2| has to be
% expanded once as it is handed in as a token storing the real argument in later
% use.
%    \begin{macrocode}
\cs_generate_variant:Nn \seq_set_split:Nnn { Nno }
\cs_new_protected:Npn \tw@mk@indrisloop #1 #2 #3
  {
    \__twmk_pushseq:
    \__twmk_pushint:
    \seq_set_split:Nno \l__twmk_indris_seq {#1} {#2}
    \int_zero:N \l__twmk_indris_int
    \bool_do_while:nn { \bool_not_p:n { \seq_if_empty_p:N \l__twmk_indris_seq } }
      {
        \int_incr:N \l__twmk_indris_int
        \seq_pop_left:NN \l__twmk_indris_seq \l__twmk_indris_tl
        \exp_args:No #3 \l__twmk_indris_tl
      }
    \__twmk_popseq:
    \__twmk_popint:
  }
\ExplSyntaxOff
%    \end{macrocode}
%
% \subsection{Helper macros}
% \begin{macro}{\tw@mk@error}\begin{macro}{\tw@mk@warning}
% \begin{macro}{\tw@mk@warning@noline}
% Define macros to call |\PackageError| and warnings
%    \begin{macrocode}
\newcommand*{\tw@mk@error}[2][Please consult the manual for more information.]{%
   \PackageError{menukeys}{#2}{#1}%
}
\newcommand*{\tw@mk@warning}[1]{%
   \PackageWarning{menukeys}{#1}%
}
\newcommand*{\tw@mk@warning@noline}[1]{%
   \PackageWarningNoLine{menukeys}{#1}%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% \begin{macro}{\tw@mk@tempa}\begin{macro}{\tw@mk@tempb}
% Some commands for temporary use:
%    \begin{macrocode}
\def\tw@mk@tempa{}
\def\tw@mk@tempb{}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\tw@mk@gobble@args}
% Define a command to gobble arguments.
%    \begin{macrocode}
\DeclareDocumentCommand{\tw@mk@gobble@args}{m}{%
   \RenewDocumentCommand{\tw@mk@tempa}{#1}{}%
   \tw@mk@tempa%
}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Options}
% First we declare and process the package options
%    \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=tw@mk,
  prefix=tw@mk@
}
\DeclareBoolOption[true]{definemenumacros}
\DeclareBoolOption[true]{definekeys}
\DeclareBoolOption[false]{hyperrefcolorlinks}
\DeclareStringOption[mac]{os}
\DeclareStringOption[symbols]{mackeys}
\ProcessKeyvalOptions{tw@mk}\relax
%    \end{macrocode}
% Now we have to do some error treatment:
%    \begin{macrocode}
\IfSubStr{.mac.win.}{.\tw@mk@os.}{}{%
   \tw@mk@error{Unknown value for option 'os'\MessageBreak
   Possible values are 'mac' or 'win'.}%
}
\IfSubStr{.symbols.text.}{.\tw@mk@mackeys.}{}{%
   \tw@mk@error{Unknown value for option 'mackeys'\MessageBreak
   Possible values are 'symbols' or 'text'.}%
}
%    \end{macrocode}
%
% \subsection{Workarounds}
% Some workarounds to ``solve'' some incompatibilities:
% \subsubsection{\pkg{hyperref}'s \opt{colorlinks} option}\label{sec:hyperref-colorlinks}
% \changes{v1.6}{2020/10/27}{\opt{hyperrefcolorlinks} obsolete}
% \changes{v1.5}{2016/08/08}{New option \opt{hyperrefcolorlinks}}
% There used to be an issue with using the \opt{colorlinks} option of
% \pkg{hyperref} due to \pkg{catoptions} being loaded. Since \pkg{catoptions}
% isn't required any more, this workaround isn't necessary. For backwards
% compatibility the \opt{hyperrefcolorlinks} option is still evaluated and just
% uses |\hypersetup| or |\PassOptionsToPackage| depending on whether
% \pkg{hyperref} is already loaded.
%    \begin{macrocode}
\iftw@mk@hyperrefcolorlinks
  \tw@mk@warning{The option `hyperrefcolorlinks' is obsolete}
  \@ifpackageloaded{hyperref}
    {\hypersetup{colorlinks}}
    {\PassOptionsToPackage{colorlinks}{hyperref}}
\fi
%    \end{macrocode}
%
% \subsection{Color themes}
% \subsubsection{Internal commands}
% \begin{macro}{\tw@make@color@theme}
% First we define an internal command to make a color theme
%    \begin{macrocode}
\newcommand*{\tw@make@color@theme}[8]{%
   \definecolor{tw@color@theme@#1@bg}{#2}{#3}%
   \definecolor{tw@color@theme@#1@br}{#2}{#4}%
   \definecolor{tw@color@theme@#1@txt}{#2}{#5}%
   \definecolor{tw@color@theme@#1@a}{#2}{#6}%
   \definecolor{tw@color@theme@#1@b}{#2}{#7}%
   \definecolor{tw@color@theme@#1@c}{#2}{#8}%
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{User-level commands}
% \begin{macro}{\newmenucolortheme}\begin{macro}{\renewmenucolortheme}
% After that we define the user-level commands:
%    \begin{macrocode}
\NewDocumentCommand{\newmenucolortheme}{ m m m m m O{#3} O{#4} O{#5} }{%
   \@ifundefinedcolor{tw@color@theme@#1@bg}{%
      \tw@make@color@theme{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
   }{%
      \tw@mk@error{Color theme '#1' already defined!\MessageBreak
      Use \string\renewmenucolortheme\space instead.}%
   }
}
\NewDocumentCommand{\renewmenucolortheme}{ m m m m m O{#3} O{#4} O{#5} }{%
   \tw@make@color@theme{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\changemenucolor}\begin{macro}{\copymenucolortheme}
% Lastly we define the changing and copying commands
%    \begin{macrocode}
\newcommand*{\changemenucolor}[4]{%
   \IfSubStr{ bg br txt }{ #2 }{%
      \definecolor{tw@color@theme@#1@#2}{#3}{#4}%
   }{%
      \tw@mk@error{No such color element ('#2')!\MessageBreak
      Possible values are bg, br and txt.}
   }%
}
\newcommand*{\copymenucolortheme}[2]{%
   \@ifundefinedcolor{tw@color@theme@#1@bg}{%
      \colorlet{tw@color@theme@#1@bg}{tw@color@theme@#2@bg}%
      \colorlet{tw@color@theme@#1@br}{tw@color@theme@#2@br}%
      \colorlet{tw@color@theme@#1@txt}{tw@color@theme@#2@txt}%
      \colorlet{tw@color@theme@#1@a}{tw@color@theme@#2@a}%
      \colorlet{tw@color@theme@#1@b}{tw@color@theme@#2@b}%
      \colorlet{tw@color@theme@#1@c}{tw@color@theme@#2@c}%
   }{%
      \tw@mk@error{Color theme '#1' already defined!\MessageBreak
      Use \string\renewmenucolortheme\space instead.}
   }
}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\changemenucolortheme}
% To be able to change the color theme of a style we must define this:
%    \begin{macrocode}
\newcommand{\changemenucolortheme}[2]{%
   \ifcsundef{tw@style@#1@pre}{%
      \tw@mk@error{Style '#1' undefined!\MessageBreak
      Maybe you misspelled it?}%
   }{%
      \@ifundefinedcolor{tw@color@theme@#2@bg}{%
         \tw@mk@error{Color theme '#2' is not defined!}%
      }{%
         \csdef{tw@style@#1@color@theme}{#2}%
      }%
   }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\usemenucolor}
% To use a color of a theme we define |\usemenucolor| as following.
%    \begin{macrocode}
\newcommand{\usemenucolor}[1]{%
   tw@color@theme@\tw@current@color@theme @#1%
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{Predefined themes}
% There are two predefined color themes
%    \begin{macrocode}
\newmenucolortheme{gray}{gray}{0.95}{0.3}{0}[0.95][0][0]
\newmenucolortheme{blacknwhite}{gray}{1}{0}{0}[1][0][0]
%    \end{macrocode}
% \subsection{Styles}
% The style generating commands will set some commands that are named
% like |\tw@style@|\meta{name}|@|\meta{element}.
% \begin{macro}{\tw@default@sep}
% \begin{macro}{\tw@default@pre}
% \begin{macro}{\tw@default@post}
% Before we can define the internal
% declaring macro to use it later in the user level commands, we have to set
% some defaults for the optional arguments
%    \begin{macrocode}
\newcommand{\tw@default@sep}{%
   \hspace{0.2em plus 0.1em minus 0.5em}%
}
\newcommand{\tw@default@pre}{}
\newcommand{\tw@default@post}{}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% \subsubsection{Internal commands}
% Now we can define the internal commands.
% \begin{macro}{\tw@declare@style@simple}
% Our first step is to define the simple command.
%    \begin{macrocode}
\DeclareDocumentCommand{\tw@declare@style@simple}{%
   s m O{\tw@default@pre} m O{\tw@default@sep} O{\tw@default@post} m
}{%
   \csdef{tw@style@#2@color@theme}{#7}%
   \csdef{tw@style@#2@pre}{#3}%
   \csdef{tw@style@#2@sep}{#5}%
   \csdef{tw@style@#2@post}{#6}%
   \IfBooleanTF{#1}{%
      \csdef{tw@style@#2@single}{#4}%
      \csdef{tw@style@#2@first}{#4}%
      \csdef{tw@style@#2@mid}{#4}%
      \csdef{tw@style@#2@last}{#4}%
   }{%
      \csdef{tw@style@#2@single}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#4]{\strut\CurrentMenuElement};}}%
      \csdef{tw@style@#2@first}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#4]{\strut\CurrentMenuElement};}}%
      \csdef{tw@style@#2@mid}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#4]{\strut\CurrentMenuElement};}}%
      \csdef{tw@style@#2@last}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#4]{\strut\CurrentMenuElement};}}%
   }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\tw@declare@sytle}\begin{macro}{\tw@declare@sytle@extra@args}
% The next step is to create the extended command. This command must have
% ten arguments (including the star) so we have to define a helping macro
% to grab the last two macros.
%    \begin{macrocode}
\DeclareDocumentCommand{\tw@declare@sytle@extra@args}{%
   O{\tw@default@post} m
}{%
   \csdef{tw@style@\tw@current@style @post}{#1}%
   \csdef{tw@style@\tw@current@style @color@theme}{#2}%
}
%    \end{macrocode}
% Now we can define |\tw@declare@style|:
%    \begin{macrocode}
\DeclareDocumentCommand{\tw@declare@style}{%
   s m O{\tw@default@pre} m O{\tw@default@sep} m m m 
}{%
   \def\tw@current@style{#2}
   \csdef{tw@style@#2@pre}{#3}%
   \csdef{tw@style@#2@sep}{#5}%
   \IfBooleanTF{#1}{%
      \csdef{tw@style@#2@single}{#8}%
      \csdef{tw@style@#2@first}{#4}%
      \csdef{tw@style@#2@mid}{#6}%
      \csdef{tw@style@#2@last}{#7}%
   }{%
      \csdef{tw@style@#2@single}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#8]{\strut\CurrentMenuElement};}}%
      \csdef{tw@style@#2@first}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#4]{\strut\CurrentMenuElement};}}%
      \csdef{tw@style@#2@mid}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#6]{\strut\CurrentMenuElement};}}%
      \csdef{tw@style@#2@last}{%
         \tikz[baseline=(tw@node.base)]{%
         \node(tw@node)[#7]{\strut\CurrentMenuElement};}}%
   }%
   \tw@declare@sytle@extra@args%
}
%    \end{macrocode}
% \end{macro}\end{macro}
% \subsubsection{User-level commands}
% \begin{macro}{newmenustylesimple}\begin{macro}{renewmenustylesimple}%
% \begin{macro}{providemenustylesimple}\begin{macro}{newmenustyle}\begin{macro}%
% {renewmenustyle}\begin{macro}{providemenustyle}
% It's time to define the user-level commands now:
%    \begin{macrocode}
\NewDocumentCommand{\newmenustylesimple}{s m}{%
   \ifcsundef{tw@style@#2@pre}{%
      \IfBooleanTF{#1}{%
         \tw@declare@style@simple*{#2}%
      }{%
         \tw@declare@style@simple{#2}%
      }%
   }{%
      \tw@mk@error{Style '#2' already defined!\MessageBreak 
      Use \string\renewmenustylesimple\space instead.}%
      \tw@mk@gobble@args{o m o o m}%
   }%
}
\NewDocumentCommand{\renewmenustylesimple}{s m}{%
   \IfBooleanTF{#1}{%
      \tw@declare@style@simple*{#2}%
   }{%
     \tw@declare@style@simple{#2}%
   }%
}
\NewDocumentCommand{\providemenustylesimple}{s m}{%
   \ifcsundef{tw@style@#2@pre}{%
      \IfBooleanTF{#1}{%
         \tw@declare@style@simple*{#2}%
      }{%
         \tw@declare@style@simple{#2}%
      }%
   }{%
      \tw@mk@warning{Trying to provide style '#2' failed,\MessageBreak
      because it's already defined.\MessageBreak 
      You may use \string\renewmenustylesimple\space instead.}%
      \tw@mk@gobble@args{o m o o m}%
   }%
}

\NewDocumentCommand{\newmenustyle}{s m}{%
   \ifcsundef{tw@style@#2@pre}{%
      \IfBooleanTF{#1}{%
         \tw@declare@style*{#2}%
      }{%
         \tw@declare@style{#2}%
      }%
   }{%
      \tw@mk@error{Style '#2' already defined!\MessageBreak 
      Use \string\renewmenustyle\space instead.}%
      \tw@mk@gobble@args{o m o m m m o m}%
   }%
}
\NewDocumentCommand{\renewmenustyle}{s m}{%
   \IfBooleanTF{#1}{%
      \tw@declare@style*{#2}%
   }{%
     \tw@declare@style{#2}%
   }%
}
\NewDocumentCommand{\providemenustyle}{s m}{%
   \ifcsundef{tw@style@#2@pre}{%
      \IfBooleanTF{#1}{%
         \tw@declare@style*{#2}%
      }{%
         \tw@declare@style{#2}%
      }%
   }{%
      \tw@mk@warning{Trying to provide style #2 failed,\MessageBreak
      because it's already defined.\MessageBreak 
      You may use \string\renewmenustyle\space instead.}%
      \tw@mk@gobble@args{o m o m m m o m}%
   }%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% 
% \subsubsection{Copying and changing}
% \begin{macro}{\copymenustyle}
% The last two steps in this part are to define a command to copy
% styles
%    \begin{macrocode}
\newcommand*{\copymenustyle}[2]{%
   \ifcsundef{tw@style@#1@pre}{%
      \ifcsundef{tw@style@#2@pre}{%
         \tw@mk@error{Can't copy not existing style ('#2')!}%
      }{%
         \csletcs{tw@style@#1@pre}{tw@style@#2@pre}%
         \csletcs{tw@style@#1@post}{tw@style@#2@post}%
         \csletcs{tw@style@#1@sep}{tw@style@#2@sep}%
         \csletcs{tw@style@#1@single}{tw@style@#2@single}%
         \csletcs{tw@style@#1@first}{tw@style@#2@first}%
         \csletcs{tw@style@#1@mid}{tw@style@#2@mid}%
         \csletcs{tw@style@#1@last}{tw@style@#2@last}%
         \csletcs{tw@style@#1@color@theme}{tw@style@#2@color@theme}
      }%
   }{%
      \tw@mk@error{Style '#1' already exists!}%
   }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\changemenuelement}
% and one to change a single element of a style.
%    \begin{macrocode}
\NewDocumentCommand{\changemenuelement}{s m m m}{%
   \ifcsundef{tw@style@#2@pre}{%
      \tw@mk@error{Style '#2' undefined.}%
   }{%
      \IfSubStr{ single first middle last pre post sep }{ #3 }{%
         \IfBooleanTF{#1}{%
            \csdef{tw@style@#2@#3}{#4}%
         }{%
            \IfSubStr{ pre post sep }{ #3 }{%
               \csdef{tw@style@#2@#3}{#4}%
            }{%
            \csdef{tw@style@#2@#3}{%
               \tikz[baseline=(tw@node.base)]{%
               \node(tw@node)[#4]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}}%
            }%
         }%
      }{\tw@mk@error{No element '#3'. Possible values are\MessageBreak
        single, first, middle, last, pre, post or sep.}}%
   }%
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{Predefined styles}
% We define several styles for menu sequences, paths and keystrokes.
% \begin{macro}{tw@set@tikz@colors}
% First we define a \TikZ-style to apply the color theme to a node
% easily
%    \begin{macrocode}
\tikzset{tw@set@tikz@colors/.style={%
   draw=\usemenucolor{br},
   fill=\usemenucolor{bg},
   text=\usemenucolor{txt},
}}
%    \end{macrocode}
% \end{macro}
% Now we can define the styles. To keep the most settings of
% a style together we make additional \TikZ-styles instead of setting
% everything directly to the |node|s.
%    \begin{macrocode}
\tikzset{tw@menus@base/.style={%
   tw@set@tikz@colors,
   rounded corners=0.15ex,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
   signal,
   signal to=nowhere,
   signal pointer angle=110,
}}
\tw@declare@style*{menus}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menus@base,signal to=east]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]%
{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menus@base,signal from=west,signal to=east]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menus@base,signal from=west,]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@menus@base]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{gray}

\tikzset{tw@roundedmenus@base/.style={%
   tw@set@tikz@colors,
   rounded corners=0.3ex,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
   signal,
   signal to=nowhere,
   signal pointer angle=110,
}}
\tw@declare@style*{roundedmenus}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@roundedmenus@base,signal to=east]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]%
{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@roundedmenus@base,signal from=west,signal to=east]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@roundedmenus@base,signal from=west,]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@roundedmenus@base]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{gray}

\tikzset{tw@angularmenus@base/.style={%
   tw@set@tikz@colors,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
   signal,
   signal to=nowhere,
   signal pointer angle=110,
}}
\tw@declare@style*{angularmenus}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@angularmenus@base,signal to=east]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]%
{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@angularmenus@base,signal from=west,signal to=east]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@angularmenus@base,signal from=west,]%
      {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@angularmenus@base]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}{gray}

\tikzset{tw@roundedkeys@base/.style={%
   tw@set@tikz@colors,
   rounded corners=0.3ex,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
}}
\tw@declare@style@simple*{roundedkeys}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@roundedkeys@base]%
         {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}[%
   \hspace{0.1em plus 0.1em minus 0.05em}%
   \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}%
   \hspace{0.1em plus 0.1em minus 0.05em}%
]{gray}

\tikzset{tw@shadowedroundedkeys@base/.style={%
   tw@set@tikz@colors,
   rounded corners=0.3ex,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
   general shadow={%
      shadow xshift=.2ex, shadow yshift=-.15ex,
      fill=\usemenucolor{c},
   },
}}
\tw@declare@style@simple*{shadowedroundedkeys}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@shadowedroundedkeys@base]%
         {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};%
   }%
}[%
   \hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}%
   \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}%
   \hspace{0.1em plus 0.1em minus 0.05em}%
][\hspace{0.2ex}]{gray}

\tikzset{tw@angularkeys@base/.style={%
   tw@set@tikz@colors,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
}}
\tw@declare@style@simple*{angularkeys}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@angularkeys@base]%
         {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}[%
   \hspace{0.1em plus 0.1em minus 0.05em}%
   \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}%
   \hspace{0.1em plus 0.1em minus 0.05em}%
]{gray}

\tikzset{tw@shadowedangularkeys@base/.style={%
   tw@set@tikz@colors,
   inner sep=0pt,
   inner xsep=2pt,
   text height=1.825ex,
   text depth=0.7ex,
   minimum width=1.5em,
   font=\relsize{-1}\sffamily,
   general shadow={%
      shadow xshift=.2ex, shadow yshift=-.15ex,
      fill=\usemenucolor{c},
   },
}}
\tw@declare@style@simple*{shadowedangularkeys}{%
   \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{%
      \node(tw@node)[tw@shadowedangularkeys@base]%
         {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}%
}[%
   \hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}%
   \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}%
   \hspace{0.1em plus 0.1em minus 0.05em}%
][\hspace{0.2ex}]{gray}

\tikzset{tw@typewriterkeys@base/.style={%
   tw@set@tikz@colors,
   shape=circle,
   minimum size=2ex,
   inner sep=0.5pt, outer sep=1pt,
   font=\ttfamily\relsize{-1},
}}
\tw@declare@style@simple*{typewriterkeys}{%
   \def\tw@typewriterkeys@curr@elem{%
      \maxsizebox*{2ex}{2ex}{\CurrentMenuElement}%
   }%
   \begin{tikzpicture}[baseline={($(tw@node.south)+(0,0.8ex)$)}]%
      \node(tw@node)[%
         tw@typewriterkeys@base, inner sep=1.25pt, line width=0.6pt%
      ]{\color{\usemenucolor{txt}}\tw@typewriterkeys@curr@elem};
      \node[tw@typewriterkeys@base]%
         {\color{\usemenucolor{txt}}\tw@typewriterkeys@curr@elem};
   \end{tikzpicture}%
}[%
   \hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}%
   \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}%
   \hspace{0.1em plus 0.1em minus 0.05em}%
]{blacknwhite}

\tw@declare@style@simple*{paths}{%
   {\ttfamily\color{\usemenucolor{txt}}\CurrentMenuElement}%
}[%
   \hspace{0.2em plus 0.1em}%
   \raisebox{0.08ex}{%
      \tikz{\fill[\usemenucolor{c}] (0,0) -- (0.5ex,0.5ex)%
                -- (0,1ex) -- cycle;}%
   }%
   \hspace{0.2em plus 0.1em}%
]{blacknwhite}

\newcounter{tw@hyphen@char@num}
\newif\if@tw@hyphenatepaths@warnig
\@tw@hyphenatepaths@warnigtrue
\tw@declare@style@simple*{hyphenatepaths}{%
   {\ttfamily
    \IfStrEq{T1}{\encodingdefault}{%
       \setcounter{tw@hyphen@char@num}{23}%
    }{%
       \IfStrEq{OT1}{\encodingdefault}{%
          \setcounter{tw@hyphen@char@num}{255}%
       }{%
          \if@tw@hyphenatepaths@warnig%
          \tw@mk@warning{The hyphenatepaths styles will probably only\MessageBreak
          work with T1 or OT1 encoding.}%
          \fi\global\@tw@hyphenatepaths@warnigfalse%
       }%
    }%
    \hyphenchar\font=\value{tw@hyphen@char@num}\relax
    \color{\usemenucolor{txt}}%
    \CurrentMenuElement}%
}[%
   \hspace{0.2em plus 0.1em}%
   \raisebox{0.08ex}{%
      \tikz{\fill[\usemenucolor{c}] (0,0) -- (0.5ex,0.5ex)%
                -- (0,1ex) -- cycle;}%
   }%
   \hspace{0.2em plus 0.1em}%
]{blacknwhite}

\NewDocumentCommand{\drawtikzfolder}{O{white} O{black}}{%
   \begin{tikzpicture}[rounded corners=0.02ex,scale=0.7]
      \draw [#2] (0,0) -- (1em,0) -- (1em,1.5ex) -- (0.5em,1.5ex) -- %
            (0.4em,1.7ex) -- (0.1em,1.7ex) -- (0,1.5ex) -- cycle;
      \draw [#2,fill=#1] (0,0) -- (1em,0) -- (0.85em,1.15ex) -- %
            ++(-1em,0) -- cycle;
   \end{tikzpicture}%
}

\copymenustyle{pathswithfolder}{paths}
\changemenuelement{pathswithfolder}{pre}{%
   \drawtikzfolder[\usemenucolor{a}][\usemenucolor{b}]%
   \hspace{0.2em plus 0.1em}%
}

\copymenustyle{pathswithblackfolder}{paths}
\changemenuelement{pathswithblackfolder}{pre}{%
   \drawtikzfolder[\usemenucolor{c}][\usemenucolor{b}]%
   \hspace{0.2em plus 0.1em}%
}

\copymenustyle{hyphenatepathswithfolder}{hyphenatepaths}
\changemenuelement{hyphenatepathswithfolder}{pre}{%
   \drawtikzfolder[\usemenucolor{a}][\usemenucolor{b}]%
   \hspace{0.2em plus 0.1em}%
}

\copymenustyle{hyphenatepathswithblackfolder}{hyphenatepaths}
\changemenuelement{hyphenatepathswithblackfolder}{pre}{%
   \drawtikzfolder[\usemenucolor{c}][\usemenucolor{b}]%
   \hspace{0.2em plus 0.1em}%
}
%    \end{macrocode}
%
% \subsection{Menu macros}
% \subsubsection{Internal commands}
% \begin{macro}{\tw@default@input@sep}
% First we define our default input separator
%    \begin{macrocode}
\edef\tw@default@input@sep{,}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\CurrentMenuElement} and the |\CurrentMenuElement| dummy
%    \begin{macrocode}
\def\CurrentMenuElement{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\tw@define@menu@macro}
% \changes{v1.1a}{2013/05/28}{Fixed minor bug, that causes a warning about robustifying (issue \#23),
%    by deleting the line to make the command robust.}
% \changes{v1.2}{2013/07/23}{Replaced \cs{edef} by \cs{protected@edef}}
% \changes{v1.2c}{2013/07/23}{Replaced \cs{protected@edef} by \cs{def}}
% \changes{v1.2}{2013/07/23}{Added \cs{leavevmode}}
% \changes{v1.6}{2020/10/27}{Don't use \cs{NewDocumentCommand}}
% Then we set up the internal command to create new menu macros.
% The list parsing code was essentially provided by Ahmed Musa at
% \url{http://tex.stackexchange.com/a/44989/4918}. Jonathan P.\@ Spratte
% made some major changes to make \pkg{menukeys} work without \pkg{catoptions}
% and reimplemented the parsing code usding \LaTeX3. Thank you both very much!
%    \begin{macrocode}
\begingroup
\lccode`\,=1
\lowercase{\endgroup
  \@ifdefinable\tw@mk@test@input@sep
    {%
      \protected\def\tw@mk@test@input@sep#1{%
        \tw@mk@xifinsetTF
          {,\tw@mk@trimspaces{#1},}{,bslash,backslash,directory,location,}%
      }%
    }%
}
\newcommand\tw@define@menu@macro[4]{%
   \ifcsundef{tw@style@#4@sep}{%
      \tw@mk@error{Can't define menu macro \string#2\space,\MessageBreak
      because the style '#4' is not available!}
   }{%
      \csdef{tw@parse@menu@list@\expandafter\@gobble\string#2}##1{%
         \tw@mk@iflastindris
          {%
            \ifnum\tw@mk@indrisnr=\@ne
                \def\CurrentMenuElement{##1}%
                \@nameuse{tw@style@#4@single}%
            \else
                \def\CurrentMenuElement{##1}%
                \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@last}%
            \fi
          }
          {%
            \ifnum\tw@mk@indrisnr=\@ne
               \def\CurrentMenuElement{##1}%
               \@nameuse{tw@style@#4@first}%
            \else
               \def\CurrentMenuElement{##1}%
               \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@mid}%
            \fi
          }%
      }%
      #1 #2 { +O{#3} +m }{%
         \leavevmode%
         {\def\tw@current@color@theme{\csname tw@style@#4@color@theme\endcsname}%
         \@nameuse{tw@style@#4@pre}%
         \tw@mk@test@input@sep{##1}{%
            \edef\tw@menu@list{\detokenize{##2}}\edef\tw@mk@tempa{\@backslashchar}%
         }{%
            \edef\tw@menu@list{\unexpanded{##2}}\edef\tw@mk@tempa{\tw@mk@trimspaces{##1}}%
         }%
         {\letcs{\tw@mk@tempb}{tw@parse@menu@list@\expandafter\@gobble\string#2}%
         \tw@mk@expanded{\tw@mk@indrisloop{\tw@mk@tempa}}\tw@menu@list\tw@mk@tempb}%
         \@nameuse{tw@style@#4@post}}%
      }%
   }%
}
%    \end{macrocode}
% \end{macro}
% \subsubsection{User-level commands}
% \begin{macro}{\newmenumacro}
% \changes{v1.1a}{2013/05/28}{Added a line to make a new macro robust.}
% \changes{v1.6}{2020/10/27}{use \cs{NewDocumentCommand}}
% \begin{macro}{\renewmenumacro}
% \changes{v1.6}{2020/10/27}{use \cs{RenewDocumentCommand}}
% \begin{macro}{\providemenumacro}
% \changes{v1.6}{2020/10/27}{use \cs{ProvideDocumentCommand}}
% Now it's time to build the user-level commands
%    \begin{macrocode}
\NewDocumentCommand{\newmenumacro}{m O{\tw@default@input@sep} m}{%
   \ifcsundef{\expandafter\@gobble\string#1}{%
      \tw@define@menu@macro\NewDocumentCommand{#1}{#2}{#3}%
   }{%
      \tw@mk@error{Menu macro '\string#1' already defined!\MessageBreak
      Use \string\renewmenustyle\space instead.}%
   }%
}
\NewDocumentCommand{\renewmenumacro}{m O{\tw@default@input@sep} m}{%
   \tw@define@menu@macro\RenewDocumentCommand{#1}{#2}{#3}%
}
\NewDocumentCommand{\providemenumacro}{m O{\tw@default@input@sep} m}{%
   \ifcsundef{\expandafter\@gobble\string#1}{%
      \tw@define@menu@macro\ProvideDocumentCommand{#1}{#2}{#3}%
   }{%
      \tw@mk@warning{Menu macro '\string#1' already defined!\MessageBreak
      Use \string\renewmenustyle\space to redefine it.}%
   }%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \subsubsection{Predefined menu macros}
% Now we got all tools to predefine some menu macros. To be sure that
% these commands won't conflict with other packages we introduced the
% option |definemacros|. Here we have to check it:
%    \begin{macrocode}
\iftw@mk@definemenumacros
%    \end{macrocode}
% \begin{macro}{\menu}\begin{macro}{\directory}%
% \changes{v1.1}{2012/02/27}{Renamed \cmd{\path} to \cmd{\directory} because it
%    crashes with \pkg{biblatex}}
% \begin{macro}{\keys}
% And then we define three basic macros.
%    \begin{macrocode}
\newmenumacro{\menu}[>]{menus}
\newmenumacro{\directory}[/]{paths}
\newmenumacro{\keys}[+]{roundedkeys}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% Lastly we close the |definemacros| if statement:
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \subsection{Keys}
% Before we define anything we check if the user allows it:
%    \begin{macrocode}
\iftw@mk@definekeys
%    \end{macrocode}
%
% Before define the key macros we create some macros that save some typing by
% condensing the similarities between the key macros.
% \begin{macro}{\tw@make@key@box}
% The first of these macros helps us building save boxes
% to store the |{tikzpicture}|, that will draw the key later.
% This is necessary because otherwise the picture will inherit
% the style of the key sequence |node|.
%    \begin{macrocode}
\NewDocumentCommand{\tw@make@key@box}{m m}{%
%   \expandafter\newbox\csname tw@mk@box@#1\endcsname
%   \expandafter\sbox\csname tw@mk@box@#1\endcsname{%
%      #2%
%   }%
   \csdef{tw@mk@#1}{%
%      \expandafter\usebox\csname tw@mk@box@#1\endcsname%
      #2%
   }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\tw@make@key@macro}
% The next macro defines the user level command by accessing a
% macro like |tw@mk@|\meta{key} or |tw@mk@|\meta{key}|@|\meta{os},
% if the appearance differs between Mac and Windows.
% To use this macro we assume that the |tw@mk@|\meta{key} commands
% are defined.
%    \begin{macrocode}
\NewDocumentCommand{\tw@make@key@macro}{s m}{%
   \IfBooleanTF{#1}{%
      \expandafter\providecommand\csname\expandafter\@gobble\string#2\endcsname{%
         \expandonce{\maxsizebox{!}{1.8ex}{%
            \@nameuse{tw@mk@\expandafter\@gobble\string#2@\tw@mk@os}}%
         }%
      }%
      \expandafter\providecommand\csname\expandafter\@gobble\string#2mac\endcsname{%
         \expandonce{\maxsizebox{!}{1.8ex}{%
            \@nameuse{tw@mk@\expandafter\@gobble\string#2@mac}}%
         }%
      }%
      \expandafter\providecommand\csname\expandafter\@gobble\string#2win\endcsname{%
         \expandonce{\maxsizebox{!}{1.8ex}{%
            \@nameuse{tw@mk@\expandafter\@gobble\string#2@win}}%
         }%
      }%
   }{%
      \expandafter\providecommand\csname\expandafter\@gobble\string#2\endcsname{%
         \expandonce{\maxsizebox{!}{1.8ex}{%
            \@nameuse{tw@mk@\expandafter\@gobble\string#2}}%
         }%
      }%
   }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\tw@define@mackey}
% The last helping macro is |\tw@define@mackey|. We use it to execute
% code depending on the |mackeys| option.
%    \begin{macrocode}
\newcommand*{\tw@define@mackey}[2]{%
   \IfStrEq{text}{\tw@mk@mackeys}{#1}{%
      \IfStrEq{symbols}{\tw@mk@mackeys}{#2}{}%
   }%
}
%    \end{macrocode}
% \end{macro}
%
% Next thing to do is to set up some \TikZ-styles.
%    \begin{macrocode}
\tikzset{
   menukeys key symbol/.style={
      rounded corners=0pt,
      line width=0.1ex,
      baseline={(0,0)},
   },
   menukeys thick/.style={line width=0.25ex},
}
%    \end{macrocode}
%
% Now we ar prepared to generate the key macros. I will be nearly the same
% way for all keys. Step one is to build a |tw@mk@|\meta{key} macro
% and then we define the user-level command |\|\meta{key}
% \begin{macro}{\shift}
%    \begin{macrocode}
\normalsize
\tw@make@key@box{shift}{%
   \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol]
      \draw (0.3ex,0) -- (1.1ex,0) -- (1.1ex,1.2ex) -- %
            (1.5ex,1.2ex) -- (0.7ex,1.9ex) -- (-0.1ex,1.2ex) -- %
            (0.3ex,1.2ex) -- cycle;
   \end{tikzpicture}%
}
\tw@make@key@macro{\shift}
%    \end{macrocode}
% \end{macro}
% It's a little more complicated if the appearance should differ depending on the
% OS: The first step again is to define |tw@mk@|\meta{key}|@mac| and
% |tw@mk@|\meta{key}|@win|. And then use the starred version
% |\tw@make@key@macro*| which creates |\|\meta{key} that depends on the |os|
% option, |\|\meta{key}|mac| and |\|\meta{key}|win|, that are not affected by
% |os|.
% \begin{macro}{\capslock}
%    \begin{macrocode}
\tw@make@key@box{capslock@mac}{%
   \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol]
      \draw (0.3ex,0.7ex) -- (1.1ex,0.7ex) -- (1.1ex,1.2ex) -- %
            (1.5ex,1.2ex) -- (0.7ex,1.9ex) -- (-0.1ex,1.2ex) -- %
            (0.3ex,1.2ex) -- cycle;
      \draw (0.3ex,0) rectangle (1.1ex,0.4ex);
   \end{tikzpicture}%
}
\tw@make@key@box{capslock@win}{%
   \begin{tikzpicture}[yscale=-1,yshift=-1.8ex,menukeys key symbol]
      \draw (0.3ex,0) -- (1.1ex,0) -- (1.1ex,1.2ex) -- %
            (1.5ex,1.2ex) -- (0.7ex,1.9ex) -- (-0.1ex,1.2ex) -- %
            (0.3ex,1.2ex) -- cycle;
   \end{tikzpicture}%
}
\tw@make@key@macro*{\capslock}
%    \end{macrocode}
% \end{macro}
% Here are the other macros:
% \begin{macro}{\tab}
%    \begin{macrocode}
\tw@make@key@box{tab@mac}{%
   \begin{tikzpicture}[yshift=0.6ex,menukeys key symbol]
      \draw [->] (0,0) -- (1em,0);
      \draw (1em,-0.35ex) -- (1em,0.35ex);
   \end{tikzpicture}%
}
\tw@make@key@box{tab@win}{%
   \begin{tikzpicture}[yshift=0.1ex,menukeys key symbol]
      \draw [->] (0.2em,0) -- (1.2em,0);
      \draw (1.2em,-0.35ex) -- (1.2em,0.35ex);
      \draw [<-] (0,1ex) -- (1em,1ex);
      \draw (0,0.65ex) -- (0,1.35ex);
   \end{tikzpicture}%
}
\tw@make@key@macro*{\tab}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\esc}\begin{macro}{\oldesc}
% \changes{v1.4}{2016/04/17}{Fixed direction of \cs{escmac}; added \cs{oldesc}}
%    \begin{macrocode}
\def\tw@mk@esc@win{Esc}
\tw@define@mackey{%
   \def\tw@mk@esc@mac{esc}
}{%
   \tw@make@key@box{esc@mac}{%
      \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol]
         \draw [->] (0.5ex,0.5ex) -- ++(135:1.1ex);
         \draw (0.5ex,0.5ex) ++(105:0.6ex) arc (105:-195:0.6ex);
      \end{tikzpicture}%
   }%
}
\tw@make@key@macro*{\esc}
\def\tw@mk@oldesc@win{Esc}
\tw@define@mackey{%
   \def\tw@mk@oldesc@mac{esc}
}{%
   \tw@make@key@box{oldesc@mac}{%
      \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol]
         \draw [->] (0.5ex,0.5ex) -- ++(45:1.1ex);
         \draw (0.5ex,0.5ex) ++(15:0.6ex) arc (15:-285:0.6ex);
      \end{tikzpicture}%
   }%
}
\tw@make@key@macro*{\oldesc}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\ctrl}
%    \begin{macrocode}
\providecommand\ctrlname{Ctrl}
\def\tw@mk@ctrl@win{\ctrlname}
\def\tw@mk@ctrl@mac{ctrl}
\tw@make@key@macro*{\ctrl}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Alt}
% \begin{macro}{\AltGr}
%    \begin{macrocode}
\def\tw@mk@Alt@win{Alt}
\tw@define@mackey{%
   \def\tw@mk@Alt@mac{alt}%
}{%
   \tw@make@key@box{Alt@mac}{%
      \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol]
         \draw (0,1ex) -- (0.5ex,1ex) -- (1ex,0.3ex) -- (1.8ex,0.3ex);
         \draw (0.8ex,1ex) -- (1.8ex,1ex);
      \end{tikzpicture}%
   }%
}
\tw@make@key@macro*{\Alt}
\providecommand*{\AltGr}{Alt\,Gr}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\cmd}
%    \begin{macrocode}
\def\tw@mk@cmd@win{%
   \tw@mk@warning{'\string\cmd' only for Mac!}%
}
\tw@define@mackey{%
   \def\tw@mk@cmd@mac{cmd}%
}{%
   \tw@make@key@box{cmd@mac}{%
      \begin{tikzpicture}[yshift=-0.15ex,menukeys key symbol]
         \draw (0.5ex,0.7ex) -- (0.5ex,1.25ex) arc (0:270:0.25ex) -- %
               (1.25ex,1ex) arc (-90:180:0.25ex) -- (1ex,0.25ex) %
               arc (-180:90:0.25ex) -- (0.25ex,0.5ex) arc (90:360:0.25ex) %
               -- cycle;
      \end{tikzpicture}%
   }%
}
\tw@make@key@macro*{\cmd}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\Space}\begin{macro}{\SPACE}
%    \begin{macrocode}
\providecommand*{\Space}{\expandonce{\rule{3em}{0pt}}}
\newcommand{\spacename}{Space}
\providecommand*{\SPACE}{\expandonce{\rule{2em}{0pt}\spacename\rule{2em}{0pt}}}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\return}
%    \begin{macrocode}
\tw@make@key@box{return@mac}{%
   \begin{tikzpicture}[yshift=0.25ex,menukeys key symbol]
      \draw [->, rounded corners=0.2ex] (1.25ex,1ex) -| %
            (2ex,0) -- (0,0);
   \end{tikzpicture}%
}
\tw@make@key@box{return@win}{%
   \begin{tikzpicture}[menukeys key symbol]
      \draw [->] (1ex,1.25ex) |- (0,0);
   \end{tikzpicture}%
}
\tw@make@key@macro*{\return}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\enter}
%    \begin{macrocode}
\def\tw@mk@enter@win{Enter}
\tw@make@key@box{enter@mac}{%
   \begin{tikzpicture}[menukeys key symbol]
      \draw (0,0) -- (0.5ex,0.5ex) -- (1ex,0);
      \draw (0,0.55ex) -- (1ex,0.55ex);
   \end{tikzpicture}%
}
\tw@make@key@macro*{\enter}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\winmenu}
%    \begin{macrocode}
\def\tw@mk@winmenu@mac{%
   \tw@mk@warning{'\string\winmenu' only for Windows!}%
}
\tw@make@key@box{winmenu@win}{%
   \begin{tikzpicture}[yshift=-0.2ex,menukeys key symbol]
      \draw (0,0) rectangle (1.5ex,1.8ex);
      \draw (0.25ex,1.4ex) -- ++(1ex,0);
      \draw (0.25ex,1ex) -- ++(1ex,0);
      \draw (0.25ex,0.6ex) -- ++(1ex,0);
   \end{tikzpicture}%
}
\tw@make@key@macro*{\winmenu}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\backspace}
%    \begin{macrocode}
\tw@make@key@box{backspace}{%
   \begin{tikzpicture}[yshift=0.65ex,menukeys key symbol]
      \draw [<-,menukeys thick] (0,0) -- (1.35em,0);
   \end{tikzpicture}%
}
\tw@make@key@macro{\backspace}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\del}\begin{macro}{\backdel}
% \changes{v1.4}{2016/04/17}{Added \cs{backdel}}
%    \begin{macrocode}
\providecommand{\delname}{Del.}
\def\tw@mk@del@win{\delname}
\tw@define@mackey{%
   \def\tw@mk@del@mac{\delname}%
}{%
   \tw@make@key@box{del@mac}{%
      \begin{tikzpicture}[yshift=0.2ex,menukeys key symbol]
         \draw (0,0) -- (1.5ex,0) -- (2ex,0.5ex) --%
               (1.5ex,1ex) -- (0,1ex) -- cycle;
         \draw (0.5ex,0.2ex) -- (1.1ex,0.8ex);
         \draw (0.5ex,0.8ex) -- (1.1ex,0.2ex);
      \end{tikzpicture}%
   }%
}
\tw@make@key@macro*{\del}
\def\tw@mk@backdel@win{\delname}
\tw@define@mackey{%
   \def\tw@mk@backdel@mac{\delname}%
}{%
   \tw@make@key@box{backdel@mac}{%
      \begin{tikzpicture}[yshift=0.2ex,menukeys key symbol]
         \draw (2ex,0) -- (0.5ex,0) -- (0,0.5ex) --%
               (0.5ex,1ex) -- (2ex,1ex) -- cycle;
         \draw (1ex,0.2ex) -- (1.6ex,0.8ex);
         \draw (1ex,0.8ex) -- (1.6ex,0.2ex);
      \end{tikzpicture}%
   }%
}
\tw@make@key@macro*{\backdel}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\arrowkeyup}\begin{macro}{\arrowkeydown}
% \begin{macro}{\arrowkeyleft}\begin{macro}{\arrowkeyright}
% Lastly we define the arrow macros:
%    \begin{macrocode}
\tw@make@key@box{arrowkeyup}{%
   \begin{tikzpicture}[yshift=-0.2ex,menukeys key symbol]
      \draw [->] (0,0) -- (0,0.8em);
   \end{tikzpicture}%
}
\tw@make@key@macro{\arrowkeyup}

\tw@make@key@box{arrowkeydown}{%
   \begin{tikzpicture}[yshift=0.7em,menukeys key symbol]
      \draw [->] (0,0) -- (0,-0.8em);
   \end{tikzpicture}%
}
\tw@make@key@macro{\arrowkeydown}

\tw@make@key@box{arrowkeyright}{%
   \begin{tikzpicture}[yshift=0.5ex,menukeys key symbol]
      \draw [->] (0,0) -- (0.8em,0);
   \end{tikzpicture}%
}
\tw@make@key@macro{\arrowkeyright}

\tw@make@key@box{arrowkeyleft}{%
   \begin{tikzpicture}[yshift=0.5ex,menukeys key symbol]
      \draw [->] (0,0) -- (-0.8em,0);
   \end{tikzpicture}%
}
\tw@make@key@macro{\arrowkeyleft}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
% \begin{macro}{\arrowkey}
% And the |\arrowkey| macro that get's it's direction as argument.
%    \begin{macrocode}
\newcommand{\arrowkey}[1]{%
   \IfStrEq{^}{#1}{\arrowkeyup}{%
      \IfStrEq{v}{#1}{\arrowkeydown}{%
         \IfStrEq{<}{#1}{\arrowkeyleft}{%
            \IfStrEq{>}{#1}{\arrowkeyright}{%
               \tw@mk@error{Wrong value '#1' for \string\arrowkey\MessageBreak
               Possible values are '^', 'v', '<' or '>'}%
            }%
         }%
      }%
   }%
}
%    \end{macrocode}
% \end{macro}
% Close the |\iftw@mk@definekeys|
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
%
% \Finale
\endinput