cgit: Added cgit 0.7.3-c502865 - A CGI for git written in C
[opensde-package-nopast.git] / powerpc / powerpc-utils / stone_mod_machid.sh
blobd7235604960aa9e3da2540ae1fb4ed7f5ab40a51
1 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # Filename: package/.../powerpc-utils/stone_mod_machid.sh
5 # Copyright (C) 2004 - 2006 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 Clifford Wolf
8 # More information can be found in the files COPYING and README.
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 # --- SDE-COPYRIGHT-NOTE-END ---
16 # [MAIN] 35 machid Macintosh mouse emulation
18 write_config() {
19 cat << EOT > /etc/conf/mac_hid
20 mouse_button_emulation="$mouse_button_emulation"
21 mouse_button2_keycode="$mouse_button2_keycode"
22 mouse_button3_keycode="$mouse_button3_keycode"
23 EOT
26 set_enable() {
27 gui_menu machid_enable \
28 "Should the mouse emulation be activated. (Current: $mouse_button_emulation)" \
29 'enable emulation' 'mouse_button_emulation=1' \
30 'disable emulation' 'mouse_button_emulation=0'
31 write_config
34 set_button() {
35 gui_input "Set new keycode for button $1" \
36 `eval echo "$"$2` "$2"
37 write_config
40 main() {
41 while
42 mouse_button_emulation=1
43 mouse_button2_keycode=68 #96
44 mouse_button3_keycode=87 #125
45 [ -f /etc/conf/mac_hid ] && . /etc/conf/mac_hid
47 gui_menu machid 'Macintosh mouse button emulation.
48 Select an item to change the value:\n(Example keys: F10:68, F11: 87, Apple: 125, KP_Return: 96 - others use showkey)' \
49 "Emulation enabled ........ $mouse_button_emulation" 'set_enable' \
50 "Mouse Button 2 keycode ... $mouse_button2_keycode" 'set_button 2 mouse_button2_keycode' \
51 "Mouse Button 3 keycode ... $mouse_button3_keycode" 'set_button 3 mouse_button3_keycode' \
52 '' '' \
53 'Edit the /etc/conf/mac_hid file' \
54 "gui_edit 'MAC HID Config File' /etc/conf/mac_hid" \
55 'Configure runlevels for mac_hid service' \
56 '$STONE runlevel edit_srv mac_hid' \
57 '(Re-)Start mac_hid init script' \
58 '$STONE runlevel restart mac_hid'
59 do : ; done