You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.0 KiB

  1. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2. %
  3. % Keymap selection dialog.
  4. %
  5. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6. /keymap.inited false def
  7. /keymap.explicit false def
  8. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9. % Build keymap list.
  10. %
  11. % ( ) ==> ( )
  12. %
  13. /keymap.init {
  14. /xmenu.keymap .xm_size array def
  15. /xmenu xmenu.keymap def
  16. /keymap.inited true def
  17. xmenu .xm_current 0 put
  18. xmenu .xm_list [ keymaps { .km.display get } forall ] put
  19. xmenu .xm_title /txt_keymap put
  20. % setkeymap is called by init before panel.init, so config.keymap must be
  21. % set by now
  22. keymap.langchanged
  23. pmenu.init
  24. } def
  25. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  26. % Language changed; update keymap.
  27. %
  28. % ( ) ==> ( )
  29. %
  30. /keymap.langchanged {
  31. keymap.inited {
  32. /keymap.tmp.cnt 0 def
  33. keymaps {
  34. config.keymap eq {
  35. xmenu.keymap .xm_current keymap.tmp.cnt put exit
  36. } if
  37. /keymap.tmp.cnt inc
  38. } forall
  39. } if
  40. } def
  41. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  42. % Update keymap.
  43. %
  44. % ( ) ==> ( )
  45. %
  46. /keymap.update {
  47. /xmenu xmenu.keymap def
  48. /config.keymap keymaps xmenu .xm_current get get def
  49. /keymap.explicit true def
  50. window.action actRedraw eq { pmenu.update } if
  51. } def
  52. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  53. % Show keymap menu.
  54. %
  55. % ( ) => ( )
  56. %
  57. /panel.keymap {
  58. "keymap" help.setcontext
  59. window.xmenu
  60. dup .xmenu xmenu.keymap put
  61. dup .xmenu.update /keymap.update put
  62. dup window.init
  63. window.show
  64. } def
  65. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  66. % Return width of panel entry.
  67. %
  68. % ( ) => ( width )
  69. %
  70. /panel.keymap.width {
  71. /xmenu xmenu.keymap def
  72. pmenu.width
  73. } def
  74. % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  75. % Redraw panel entry.
  76. %
  77. % ( panel ) => ( )
  78. %
  79. /panel.keymap.update {
  80. /xmenu xmenu.keymap def
  81. pmenu.panel.update
  82. } def