keys.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package config
  2. type (
  3. Keys struct {
  4. FocusGuildsTree string `toml:"focus_guilds_tree"`
  5. FocusMessagesText string `toml:"focus_messages_text"`
  6. FocusMessageInput string `toml:"focus_message_input"`
  7. ToggleGuildsTree string `toml:"toggle_guild_tree"`
  8. SelectPrevious string `toml:"select_previous"`
  9. SelectNext string `toml:"select_next"`
  10. SelectFirst string `toml:"select_first"`
  11. SelectLast string `toml:"select_last"`
  12. GuildsTree GuildsTreeKeys `toml:"guilds_tree"`
  13. MessagesText MessagesTextKeys `toml:"messages_text"`
  14. MessageInput MessageInputKeys `toml:"message_input"`
  15. }
  16. GuildsTreeKeys struct {
  17. SelectCurrent string `toml:"select_current"`
  18. }
  19. MessagesTextKeys struct {
  20. SelectReply string `toml:"select_reply"`
  21. Reply string `toml:"reply"`
  22. ReplyMention string `toml:"reply_mention"`
  23. Delete string `toml:"delete"`
  24. Yank string `toml:"yank"`
  25. Open string `toml:"open"`
  26. }
  27. MessageInputKeys struct {
  28. Send string `toml:"send"`
  29. Editor string `toml:"editor"`
  30. Cancel string `toml:"cancel"`
  31. }
  32. )
  33. func defaultKeys() Keys {
  34. return Keys{
  35. FocusGuildsTree: "Ctrl+G",
  36. FocusMessagesText: "Ctrl+T",
  37. FocusMessageInput: "Ctrl+P",
  38. ToggleGuildsTree: "Ctrl+B",
  39. SelectPrevious: "Rune[k]",
  40. SelectNext: "Rune[j]",
  41. SelectFirst: "Rune[g]",
  42. SelectLast: "Rune[G]",
  43. GuildsTree: GuildsTreeKeys{
  44. SelectCurrent: "Enter",
  45. },
  46. MessagesText: MessagesTextKeys{
  47. SelectReply: "Rune[s]",
  48. Reply: "Rune[r]",
  49. ReplyMention: "Rune[R]",
  50. Delete: "Rune[d]",
  51. Yank: "Rune[y]",
  52. Open: "Rune[o]",
  53. },
  54. MessageInput: MessageInputKeys{
  55. Send: "Enter",
  56. Editor: "Ctrl+E",
  57. Cancel: "Esc",
  58. },
  59. }
  60. }