A simple shortcode plugin to insert keyboard keys and controller buttons into the article.
- Get zip file from the release page
- Upload the zip file to your WordPress plugin page
- Enable the plugin
This plugin provides two shortcodes: [kbd]
and [btn]
for representing keyboard keys and controller buttons.
All names used for keys and controllers are in lowercase unless stated otherwise.
Keyboard keys are represented by [kbd]key[/kbd]
.
Some special keys that has a symbol are listed below.
left
- Left Arrowright
- Right Arrowup
- Up Arrowdown
- Down Arrowenter
- Entertab
- Tabshift
- Shiftctrl
- Control, as on IBM compatiblescmd
- Command, as on Apple keyboardshelm
- Control, as on Apple keyboardsctrls
- Control/Commandalt
- Altoption
- Option, as on Apple keyboardsalts
- Alt/Optionwin
- Windows keymeta
- Windows keybackspace
- Backspacepgdn
- Page Downpgup
- Page Uphome
- Homeend
- Enddel
- Dekteins
- Insertsysrq
- Print Screen / System Requestpause
- Pause / Breakmenu
- Menu, as on IBM compatibles, near right ctrlcompose
- Composeesc
- Escapecaps
- Caps locknum
- Num lockscroll
- Scroll lock
Xbox Series X, PlayStation 5 and Switch controller
buttons are supported. You can specify which to use
with v
parameter:
XBox A button is [btn v="xbox"]a[/btn];
Switch B button is [btn v="switch"]b[/btn];
and PlayStation Triangle button is [btn v="ps"]triangle[/btn]
Following names are recognized for XBox controllers:
a
=> Ab
=> Bx
=> Xy
=> Yview
=> Viewshare
=> Sharemenu
=> Menudu
=> DPad Updd
=> DPad Downdl
=> DPad Leftdr
=> DPad Rightls
=> Left Sticklsp
=> Left Stick Pressrs
=> Right Stickrsp
=> Right Stick Presslb
=> Left Bumperlt
=> Left Triggerrb
=> Right Bumperrt
=> Right Trigger
Following names are recognized for PlayStation controllers:
circle
=> Circlecross
=> Crosssquare
=> Squaretriangle
=> Triangleview
=> Viewshare
=> Share Altoptions
=> Options Altdu
=> DPad Updd
=> DPad Downdl
=> DPad Leftdr
=> DPad Rightls
=> Left Stickl3
=> Left Stick Presslsp
=> Left Stick Pressrs
=> Right Stickr3
=> Right Stick Pressrsp
=> Right Stick Pressl1
=> L1l2
=> L2r1
=> R1r2
=> R2
a
=> Ab
=> Bx
=> Xy
=> Yplus
=> Plusminus
=> Minushome
=> Homerecord
=> Squaredu
=> DPad Updd
=> DPad Downdl
=> DPad Leftdr
=> DPad Rightls
=> Left Sticklsp
=> Left Stickrs
=> Right Stickrsp
=> Right Stickl
=> Left Bumper (L)zl
=> Left Trigger (ZL)r
=> Right Bumper (R)zr
=> Right Trigger (ZR)
Some times you may want to talk about the buttons that usually has the same function across all platforms, like DPad right.
When using equivalence button names, v
parameter is not used.
You can use equivalence names listed below:
EquivalenceUp
=> DPad upEquivalenceDown
=> DPad downEquivalenceLeft
=> DPad leftEquivalenceRight
=> DPad rightEquivalenceSelect
=> Select key. Maps to XBox View button, PS Touchpad press, and Switch Minus button.EquivalenceStart
=> Start key. Maps to XBox Menu button, PS Option button, and Switch Plus button.EquivalenceActionUp
=> The upper action button. Maps to XBox Y button, PS Triangle button, and Switch "Up" button.EquivalenceActionDown
=> The lower action button. Maps to XBox B button, PS Cross button, and Switch "Down" button.EquivalenceActionLeft
=> The left-side action button. Maps to XBox X button, PS Square button, and Switch "Left" button.EquivalenceActionRight
=> The right-side action button. Maps to XBox A button, PS Circle button, and Switch "Right" button.EquivalenceLeftBumper
=> The left bumper. Maps to XBox LB, PS L1, and Switch L.EquivalenceLeftTrigger
=> The left trigger. Maps to XBox LT, PS L2, and Switch ZL.EquivalenceRightBumper
=> The right bumper. Maps to XBox RB, PS R1, and Switch R.EquivalenceRightTrigger
=> The right trigger. Maps to XBox RT, PS R2, and Switch ZR.EquivalenceLeftStick
=> The left stick movement.EquivalenceRightStick
=> The right stick movement.EquivalenceLeftStickPress
=> The left stick press.EquivalenceRightStickPress
=> The right stick press.
Huge thanks to Nicolae Berbece for releasing Xelu's Controllers & Keyboard Prompts under CC0 license.
Icon images made by Nicolae remain under Creative Commons 0 (CC0).
All other code is MIT licensed.