keys.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package config
  2. type (
  3. NavigationKeys struct {
  4. SelectPrevious string `toml:"select_previous"`
  5. SelectNext string `toml:"select_next"`
  6. SelectFirst string `toml:"select_first"`
  7. SelectLast string `toml:"select_last"`
  8. }
  9. Keys struct {
  10. FocusGuildsTree string `toml:"focus_guilds_tree"`
  11. FocusMessagesText string `toml:"focus_messages_text"`
  12. FocusMessageInput string `toml:"focus_message_input"`
  13. ToggleGuildsTree string `toml:"toggle_guilds_tree"`
  14. GuildsTree GuildsTreeKeys `toml:"guilds_tree"`
  15. MessagesText MessagesTextKeys `toml:"messages_text"`
  16. MessageInput MessageInputKeys `toml:"message_input"`
  17. Logout string `toml:"logout"`
  18. Quit string `toml:"quit"`
  19. }
  20. GuildsTreeKeys struct {
  21. NavigationKeys
  22. SelectCurrent string `toml:"select_current"`
  23. YankID string `toml:"yank_id"`
  24. CollapseParentNode string `toml:"collapse_parent_node"`
  25. MoveToParentNode string `toml:"move_to_parent_node"`
  26. }
  27. MessagesTextKeys struct {
  28. NavigationKeys
  29. SelectReply string `toml:"select_reply"`
  30. Reply string `toml:"reply"`
  31. ReplyMention string `toml:"reply_mention"`
  32. Cancel string `toml:"cancel"`
  33. Delete string `toml:"delete"`
  34. Open string `toml:"open"`
  35. YankContent string `toml:"yank_content"`
  36. YankURL string `toml:"yank_url"`
  37. YankID string `toml:"yank_id"`
  38. }
  39. MessageInputKeys struct {
  40. Send string `toml:"send"`
  41. Editor string `toml:"editor"`
  42. Cancel string `toml:"cancel"`
  43. }
  44. )
  45. func defaultKeys() Keys {
  46. return Keys{
  47. FocusGuildsTree: "Ctrl+G",
  48. FocusMessagesText: "Ctrl+T",
  49. FocusMessageInput: "Ctrl+P",
  50. ToggleGuildsTree: "Ctrl+B",
  51. Logout: "Ctrl+D",
  52. Quit: "Ctrl+C",
  53. GuildsTree: GuildsTreeKeys{
  54. NavigationKeys: NavigationKeys{
  55. SelectPrevious: "Rune[k]",
  56. SelectNext: "Rune[j]",
  57. SelectFirst: "Rune[g]",
  58. SelectLast: "Rune[G]",
  59. },
  60. SelectCurrent: "Enter",
  61. YankID: "Rune[i]",
  62. CollapseParentNode: "Rune[-]",
  63. MoveToParentNode: "Rune[p]",
  64. },
  65. MessagesText: MessagesTextKeys{
  66. NavigationKeys: NavigationKeys{
  67. SelectPrevious: "Rune[k]",
  68. SelectNext: "Rune[j]",
  69. SelectFirst: "Rune[g]",
  70. SelectLast: "Rune[G]",
  71. },
  72. SelectReply: "Rune[s]",
  73. Reply: "Rune[r]",
  74. ReplyMention: "Rune[R]",
  75. Cancel: "Esc",
  76. Delete: "Rune[d]",
  77. Open: "Rune[o]",
  78. YankContent: "Rune[y]",
  79. YankURL: "Rune[u]",
  80. YankID: "Rune[i]",
  81. },
  82. MessageInput: MessageInputKeys{
  83. Send: "Enter",
  84. Editor: "Ctrl+E",
  85. Cancel: "Esc",
  86. },
  87. }
  88. }