OpenSDE Packages Database (without history before r20070)
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.

61 lines
2.1 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../powerpc-utils/stone_mod_machid.sh
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. # Copyright (C) 1998 - 2003 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- T2-COPYRIGHT-NOTE-END ---
  15. #
  16. # [MAIN] 35 machid Macintosh mouse emulation
  17. write_config() {
  18. cat << EOT > /etc/conf/mac_hid
  19. mouse_button_emulation="$mouse_button_emulation"
  20. mouse_button2_keycode="$mouse_button2_keycode"
  21. mouse_button3_keycode="$mouse_button3_keycode"
  22. EOT
  23. }
  24. set_enable() {
  25. gui_menu machid_enable \
  26. "Should the mouse emulation be activated. (Current: $mouse_button_emulation)" \
  27. 'enable emulation' 'mouse_button_emulation=1' \
  28. 'disable emulation' 'mouse_button_emulation=0'
  29. write_config
  30. }
  31. set_button() {
  32. gui_input "Set new keycode for button $1" \
  33. `eval echo "$"$2` "$2"
  34. write_config
  35. }
  36. main() {
  37. while
  38. mouse_button_emulation=1
  39. mouse_button2_keycode=68 #96
  40. mouse_button3_keycode=87 #125
  41. [ -f /etc/conf/mac_hid ] && . /etc/conf/mac_hid
  42. gui_menu machid 'Macintosh mouse button emulation.
  43. Select an item to change the value:\n(Example keys: F10:68, F11: 87, Apple: 125, KP_Return: 96 - others use showkey)' \
  44. "Emulation enabled ........ $mouse_button_emulation" 'set_enable' \
  45. "Mouse Button 2 keycode ... $mouse_button2_keycode" 'set_button 2 mouse_button2_keycode' \
  46. "Mouse Button 3 keycode ... $mouse_button3_keycode" 'set_button 3 mouse_button3_keycode' \
  47. '' '' \
  48. 'Edit the /etc/conf/mac_hid file' \
  49. "gui_edit 'MAC HID Config File' /etc/conf/mac_hid" \
  50. 'Configure runlevels for mac_hid service' \
  51. '$STONE runlevel edit_srv mac_hid' \
  52. '(Re-)Start mac_hid init script' \
  53. '$STONE runlevel restart mac_hid'
  54. do : ; done
  55. }