dasher r3664 - in trunk: . Src/MacOSX Src/MacOSX/Dasher.xcodeproj Src/MacOSX/English.lproj/Preferences.nib



Author: pwelche
Date: Thu Mar 12 14:46:50 2009
New Revision: 3664
URL: http://svn.gnome.org/viewvc/dasher?rev=3664&view=rev

Log:
(a) makes the control mode list box (in the preferences pane) under mac
os x non-editable;
(b) fixes keyboard input in the OpenGL impl, allowing use of e.g.
two-button mode.



Added:
   trunk/Src/MacOSX/KeyboardHelper.cpp
      - copied, changed from r3663, /trunk/Src/Win32/KeyboardHelper.cpp
   trunk/Src/MacOSX/KeyboardHelper.h
      - copied unchanged from r3663, /trunk/Src/Win32/KeyboardHelper.h
Modified:
   trunk/ChangeLog
   trunk/Src/MacOSX/Dasher.xcodeproj/project.pbxproj
   trunk/Src/MacOSX/DasherViewOpenGL.h
   trunk/Src/MacOSX/DasherViewOpenGL.mm
   trunk/Src/MacOSX/English.lproj/Preferences.nib/classes.nib
   trunk/Src/MacOSX/English.lproj/Preferences.nib/info.nib

Modified: trunk/Src/MacOSX/Dasher.xcodeproj/project.pbxproj
==============================================================================
--- trunk/Src/MacOSX/Dasher.xcodeproj/project.pbxproj	(original)
+++ trunk/Src/MacOSX/Dasher.xcodeproj/project.pbxproj	Thu Mar 12 14:46:50 2009
@@ -390,6 +390,8 @@
 		33E173E40F3E0B6400D19B38 /* training_swedish_SE.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33E173C40F3E0B6400D19B38 /* training_swedish_SE.txt */; };
 		33E173E50F3E0B6400D19B38 /* training_turkish_TR.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33E173C50F3E0B6400D19B38 /* training_turkish_TR.txt */; };
 		33E173E60F3E0B6400D19B38 /* training_welsh_GB.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33E173C60F3E0B6400D19B38 /* training_welsh_GB.txt */; };
+		33E91A770F55E60B00B5F513 /* KeyboardHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33E91A750F55E60B00B5F513 /* KeyboardHelper.cpp */; };
+		33E91A780F55E60B00B5F513 /* KeyboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 33E91A760F55E60B00B5F513 /* KeyboardHelper.h */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -574,66 +576,6 @@
 		1974FD9C07145C6500B95DA0 /* Credits.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Credits.html; sourceTree = "<group>"; };
 		1974FE7A0714861B00B95DA0 /* Dasher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Dasher.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		1974FE7C0714861B00B95DA0 /* Info-Dasher.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Dasher.plist"; sourceTree = SOURCE_ROOT; };
-		19836C1D0C22A7FA00047426 /* Canvas.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Canvas.cpp; sourceTree = "<group>"; };
-		19836C1E0C22A7FA00047426 /* Canvas.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Canvas.h; sourceTree = "<group>"; };
-		19836C1F0C22A7FA00047426 /* CanvasExperimental.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasExperimental.cpp; sourceTree = "<group>"; };
-		19836C200C22A7FA00047426 /* CanvasExperimental.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CanvasExperimental.h; sourceTree = "<group>"; };
-		19836C210C22A7FA00047426 /* custom_marshal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = custom_marshal.cpp; sourceTree = "<group>"; };
-		19836C220C22A7FA00047426 /* custom_marshal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = custom_marshal.h; sourceTree = "<group>"; };
-		19836C230C22A7FA00047426 /* dasher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher.h; sourceTree = "<group>"; };
-		19836C240C22A7FA00047426 /* dasher_action.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_action.cpp; sourceTree = "<group>"; };
-		19836C250C22A7FA00047426 /* dasher_action.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_action.h; sourceTree = "<group>"; };
-		19836C260C22A7FA00047426 /* dasher_action_keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_action_keyboard.cpp; sourceTree = "<group>"; };
-		19836C270C22A7FA00047426 /* dasher_action_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_action_keyboard.h; sourceTree = "<group>"; };
-		19836C280C22A7FA00047426 /* dasher_action_keyboard_maemo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_action_keyboard_maemo.cpp; sourceTree = "<group>"; };
-		19836C290C22A7FA00047426 /* dasher_action_keyboard_maemo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_action_keyboard_maemo.h; sourceTree = "<group>"; };
-		19836C2A0C22A7FA00047426 /* dasher_action_script.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_action_script.cpp; sourceTree = "<group>"; };
-		19836C2B0C22A7FA00047426 /* dasher_action_script.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_action_script.h; sourceTree = "<group>"; };
-		19836C2C0C22A7FA00047426 /* dasher_action_speech.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_action_speech.cpp; sourceTree = "<group>"; };
-		19836C2D0C22A7FA00047426 /* dasher_action_speech.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_action_speech.h; sourceTree = "<group>"; };
-		19836C2E0C22A7FA00047426 /* dasher_buffer_set.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_buffer_set.cpp; sourceTree = "<group>"; };
-		19836C2F0C22A7FA00047426 /* dasher_buffer_set.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_buffer_set.h; sourceTree = "<group>"; };
-		19836C300C22A7FA00047426 /* dasher_editor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_editor.cpp; sourceTree = "<group>"; };
-		19836C310C22A7FA00047426 /* dasher_editor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_editor.h; sourceTree = "<group>"; };
-		19836C320C22A7FA00047426 /* dasher_editor_external.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_editor_external.cpp; sourceTree = "<group>"; };
-		19836C330C22A7FA00047426 /* dasher_editor_external.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_editor_external.h; sourceTree = "<group>"; };
-		19836C340C22A7FA00047426 /* dasher_editor_internal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_editor_internal.cpp; sourceTree = "<group>"; };
-		19836C350C22A7FA00047426 /* dasher_editor_internal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_editor_internal.h; sourceTree = "<group>"; };
-		19836C360C22A7FA00047426 /* dasher_external_buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_external_buffer.cpp; sourceTree = "<group>"; };
-		19836C370C22A7FA00047426 /* dasher_external_buffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_external_buffer.h; sourceTree = "<group>"; };
-		19836C380C22A7FA00047426 /* dasher_internal_buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_internal_buffer.cpp; sourceTree = "<group>"; };
-		19836C390C22A7FA00047426 /* dasher_internal_buffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_internal_buffer.h; sourceTree = "<group>"; };
-		19836C3A0C22A7FA00047426 /* dasher_lock_dialogue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_lock_dialogue.cpp; sourceTree = "<group>"; };
-		19836C3B0C22A7FA00047426 /* dasher_lock_dialogue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_lock_dialogue.h; sourceTree = "<group>"; };
-		19836C3C0C22A7FA00047426 /* dasher_maemo_helper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_maemo_helper.cpp; sourceTree = "<group>"; };
-		19836C3D0C22A7FA00047426 /* dasher_maemo_helper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_maemo_helper.h; sourceTree = "<group>"; };
-		19836C3E0C22A7FA00047426 /* dasher_main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dasher_main.cpp; sourceTree = "<group>"; };
-		19836C3F0C22A7FA00047426 /* dasher_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dasher_main.h; sourceTree = "<group>"; };
-		19836C400C22A7FA00047426 /* DasherAppSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DasherAppSettings.cpp; sourceTree = "<group>"; };
-		19836C410C22A7FA00047426 /* DasherAppSettings.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DasherAppSettings.h; sourceTree = "<group>"; };
-		19836C420C22A7FA00047426 /* DasherControl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DasherControl.cpp; sourceTree = "<group>"; };
-		19836C430C22A7FA00047426 /* DasherControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DasherControl.h; sourceTree = "<group>"; };
-		19836C440C22A7FA00047426 /* game_mode_helper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = game_mode_helper.cpp; sourceTree = "<group>"; };
-		19836C450C22A7FA00047426 /* game_mode_helper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = game_mode_helper.h; sourceTree = "<group>"; };
-		19836C460C22A7FA00047426 /* GenerateSchema.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GenerateSchema.cpp; sourceTree = "<group>"; };
-		19836C470C22A7FA00047426 /* gpesettings_store.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = gpesettings_store.cc; sourceTree = "<group>"; };
-		19836C480C22A7FA00047426 /* gpesettings_store.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gpesettings_store.h; sourceTree = "<group>"; };
-		19836C490C22A7FA00047426 /* GtkDasherControl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GtkDasherControl.cpp; sourceTree = "<group>"; };
-		19836C4A0C22A7FA00047426 /* GtkDasherControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GtkDasherControl.h; sourceTree = "<group>"; };
-		19836C4B0C22A7FA00047426 /* joystick_input.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = joystick_input.h; sourceTree = "<group>"; };
-		19836C4C0C22A7FA00047426 /* KeyboardHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardHelper.cpp; sourceTree = "<group>"; };
-		19836C4D0C22A7FA00047426 /* KeyboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KeyboardHelper.h; sourceTree = "<group>"; };
-		19836C4E0C22A7FA00047426 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
-		19836C4F0C22A7FA00047426 /* module_settings_window.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = module_settings_window.cpp; sourceTree = "<group>"; };
-		19836C500C22A7FA00047426 /* module_settings_window.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = module_settings_window.h; sourceTree = "<group>"; };
-		19836C510C22A7FA00047426 /* mouse_input.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mouse_input.h; sourceTree = "<group>"; };
-		19836C520C22A7FA00047426 /* PangoCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PangoCache.cpp; sourceTree = "<group>"; };
-		19836C530C22A7FA00047426 /* PangoCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PangoCache.h; sourceTree = "<group>"; };
-		19836C540C22A7FA00047426 /* Preferences.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Preferences.cpp; sourceTree = "<group>"; };
-		19836C550C22A7FA00047426 /* Preferences.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Preferences.h; sourceTree = "<group>"; };
-		19836C560C22A7FA00047426 /* tilt_input.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tilt_input.h; sourceTree = "<group>"; };
-		19836C570C22A7FA00047426 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = "<group>"; };
-		19836C580C22A7FA00047426 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
 		1987561F071AFB470034ECCB /* Chatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chatter.h; sourceTree = "<group>"; };
 		19875620071AFB470034ECCB /* Chatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Chatter.m; sourceTree = "<group>"; };
 		1988ABB70C9FF97000D97977 /* GameLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GameLevel.cpp; sourceTree = "<group>"; };
@@ -860,6 +802,8 @@
 		33E173C40F3E0B6400D19B38 /* training_swedish_SE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = training_swedish_SE.txt; sourceTree = "<group>"; };
 		33E173C50F3E0B6400D19B38 /* training_turkish_TR.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = training_turkish_TR.txt; sourceTree = "<group>"; };
 		33E173C60F3E0B6400D19B38 /* training_welsh_GB.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = training_welsh_GB.txt; sourceTree = "<group>"; };
+		33E91A750F55E60B00B5F513 /* KeyboardHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardHelper.cpp; sourceTree = "<group>"; };
+		33E91A760F55E60B00B5F513 /* KeyboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyboardHelper.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -909,6 +853,8 @@
 				19D4423D04546C410000000A /* PreferencesController.mm */,
 				198EC7AE07153D6E00474B38 /* KeyboardEvent.h */,
 				198EC7AF07153D6E00474B38 /* KeyboardEvent.m */,
+				33E91A760F55E60B00B5F513 /* KeyboardHelper.h */,
+				33E91A750F55E60B00B5F513 /* KeyboardHelper.cpp */,
 				198EC7B107153D6E00474B38 /* LowLevelKeyboardHandling.h */,
 				198EC7B007153D6E00474B38 /* LowLevelKeyboardHandling.c */,
 				198EC7B207153D6E00474B38 /* UnicharGenerator.h */,
@@ -1149,74 +1095,6 @@
 			path = View;
 			sourceTree = "<group>";
 		};
-		19836C1B0C22A7FA00047426 /* Gtk2 */ = {
-			isa = PBXGroup;
-			children = (
-				19836C1D0C22A7FA00047426 /* Canvas.cpp */,
-				19836C1E0C22A7FA00047426 /* Canvas.h */,
-				19836C1F0C22A7FA00047426 /* CanvasExperimental.cpp */,
-				19836C200C22A7FA00047426 /* CanvasExperimental.h */,
-				19836C210C22A7FA00047426 /* custom_marshal.cpp */,
-				19836C220C22A7FA00047426 /* custom_marshal.h */,
-				19836C230C22A7FA00047426 /* dasher.h */,
-				19836C240C22A7FA00047426 /* dasher_action.cpp */,
-				19836C250C22A7FA00047426 /* dasher_action.h */,
-				19836C260C22A7FA00047426 /* dasher_action_keyboard.cpp */,
-				19836C270C22A7FA00047426 /* dasher_action_keyboard.h */,
-				19836C280C22A7FA00047426 /* dasher_action_keyboard_maemo.cpp */,
-				19836C290C22A7FA00047426 /* dasher_action_keyboard_maemo.h */,
-				19836C2A0C22A7FA00047426 /* dasher_action_script.cpp */,
-				19836C2B0C22A7FA00047426 /* dasher_action_script.h */,
-				19836C2C0C22A7FA00047426 /* dasher_action_speech.cpp */,
-				19836C2D0C22A7FA00047426 /* dasher_action_speech.h */,
-				19836C2E0C22A7FA00047426 /* dasher_buffer_set.cpp */,
-				19836C2F0C22A7FA00047426 /* dasher_buffer_set.h */,
-				19836C300C22A7FA00047426 /* dasher_editor.cpp */,
-				19836C310C22A7FA00047426 /* dasher_editor.h */,
-				19836C320C22A7FA00047426 /* dasher_editor_external.cpp */,
-				19836C330C22A7FA00047426 /* dasher_editor_external.h */,
-				19836C340C22A7FA00047426 /* dasher_editor_internal.cpp */,
-				19836C350C22A7FA00047426 /* dasher_editor_internal.h */,
-				19836C360C22A7FA00047426 /* dasher_external_buffer.cpp */,
-				19836C370C22A7FA00047426 /* dasher_external_buffer.h */,
-				19836C380C22A7FA00047426 /* dasher_internal_buffer.cpp */,
-				19836C390C22A7FA00047426 /* dasher_internal_buffer.h */,
-				19836C3A0C22A7FA00047426 /* dasher_lock_dialogue.cpp */,
-				19836C3B0C22A7FA00047426 /* dasher_lock_dialogue.h */,
-				19836C3C0C22A7FA00047426 /* dasher_maemo_helper.cpp */,
-				19836C3D0C22A7FA00047426 /* dasher_maemo_helper.h */,
-				19836C3E0C22A7FA00047426 /* dasher_main.cpp */,
-				19836C3F0C22A7FA00047426 /* dasher_main.h */,
-				19836C400C22A7FA00047426 /* DasherAppSettings.cpp */,
-				19836C410C22A7FA00047426 /* DasherAppSettings.h */,
-				19836C420C22A7FA00047426 /* DasherControl.cpp */,
-				19836C430C22A7FA00047426 /* DasherControl.h */,
-				19836C440C22A7FA00047426 /* game_mode_helper.cpp */,
-				19836C450C22A7FA00047426 /* game_mode_helper.h */,
-				19836C460C22A7FA00047426 /* GenerateSchema.cpp */,
-				19836C470C22A7FA00047426 /* gpesettings_store.cc */,
-				19836C480C22A7FA00047426 /* gpesettings_store.h */,
-				19836C490C22A7FA00047426 /* GtkDasherControl.cpp */,
-				19836C4A0C22A7FA00047426 /* GtkDasherControl.h */,
-				19836C4B0C22A7FA00047426 /* joystick_input.h */,
-				19836C4C0C22A7FA00047426 /* KeyboardHelper.cpp */,
-				19836C4D0C22A7FA00047426 /* KeyboardHelper.h */,
-				19836C4E0C22A7FA00047426 /* Makefile.am */,
-				19836C4F0C22A7FA00047426 /* module_settings_window.cpp */,
-				19836C500C22A7FA00047426 /* module_settings_window.h */,
-				19836C510C22A7FA00047426 /* mouse_input.h */,
-				19836C520C22A7FA00047426 /* PangoCache.cpp */,
-				19836C530C22A7FA00047426 /* PangoCache.h */,
-				19836C540C22A7FA00047426 /* Preferences.cpp */,
-				19836C550C22A7FA00047426 /* Preferences.h */,
-				19836C560C22A7FA00047426 /* tilt_input.h */,
-				19836C570C22A7FA00047426 /* Timer.cpp */,
-				19836C580C22A7FA00047426 /* Timer.h */,
-			);
-			name = Gtk2;
-			path = ../Gtk2;
-			sourceTree = SOURCE_ROOT;
-		};
 		19BEF2CD0C228F7300275D06 /* alphabets */ = {
 			isa = PBXGroup;
 			children = (
@@ -1417,7 +1295,6 @@
 				19351BF304575C6C0000000A /* mktar.sh */,
 				190697550492B65B0000000A /* ReadmeDeveloper.txt */,
 				190697530492AACE0000000A /* Readme.html */,
-				19836C1B0C22A7FA00047426 /* Gtk2 */,
 				19BEF4180C22922400275D06 /* controllabels */,
 				19BEF3FC0C2291CE00275D06 /* colours */,
 				19BEF2CD0C228F7300275D06 /* alphabets */,
@@ -1612,6 +1489,7 @@
 				1988ABBD0C9FF97000D97977 /* GameMessages.h in Headers */,
 				1988ABBE0C9FF97000D97977 /* GameStatistics.h in Headers */,
 				1988ABC00C9FF97000D97977 /* PinyinParser.h in Headers */,
+				33E91A780F55E60B00B5F513 /* KeyboardHelper.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1955,6 +1833,7 @@
 				19F8C7F90C858E9900276B4F /* TrainingHelper.cpp in Sources */,
 				1988ABBF0C9FF97000D97977 /* PinyinParser.cpp in Sources */,
 				1988ABCF0C9FFADA00D97977 /* GameLevel.cpp in Sources */,
+				33E91A770F55E60B00B5F513 /* KeyboardHelper.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Src/MacOSX/DasherViewOpenGL.h
==============================================================================
--- trunk/Src/MacOSX/DasherViewOpenGL.h	(original)
+++ trunk/Src/MacOSX/DasherViewOpenGL.h	Thu Mar 12 14:46:50 2009
@@ -14,6 +14,7 @@
 #import "AlphabetLetter.h"
 #import "ColourIO.h"
 #import "DasherViewCocoa.h"
+#import "KeyboardHelper.h"
 
 @class NSColor, NSTimer, NSTextField, NSString, NSMutableDictionary;
 @class NSBezierPath;
@@ -48,7 +49,7 @@
   colour_t *colourTable;
   
   NSMutableDictionary *_letterDict;
-  
+  CKeyboardHelper *_keyboardHelper;
   
 }
 
@@ -61,6 +62,7 @@
 - (void)mouseDown:(NSEvent *)e;
 - (void)mouseUp:(NSEvent *)e;
 - (void)keyDown:(NSEvent *)e;
+- (void)keyUp:(NSEvent *)e;
 - (void)circleCallbackCentrePoint:(NSPoint)aCentrePoint radius:(float)aRadius outlineColorIndex:(int)anOutlineColorIndex fillColourIndex:(int)aFillColourIndex shouldFill:(BOOL)shouldFill lineWidth:(int)aLineWidth;
 - (void)rectangleCallbackX1:(int)x1 y1:(int)y1 x2:(int)x2 y2:(int)y2 fillColorIndex:(int)aFillColorIndex outlineColorIndex:(int)anOutlineColorIndex shouldOutline:(BOOL)shouldOutline shouldFill:(BOOL)shouldFill lineWidth:(int)aLineWidth;
 - (AlphabetLetter *)letterForString:(NSString *)aString;
@@ -73,7 +75,6 @@
 - (void)adjustTrackingRect;
 - (BOOL)isFlipped;
 - (BOOL)isOpaque;
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
 - (void)awakeFromNib;
 - (void)finishRealization;
 - (COSXDasherScreen *)aquaDasherScreen;

Modified: trunk/Src/MacOSX/DasherViewOpenGL.mm
==============================================================================
--- trunk/Src/MacOSX/DasherViewOpenGL.mm	(original)
+++ trunk/Src/MacOSX/DasherViewOpenGL.mm	Thu Mar 12 14:46:50 2009
@@ -104,6 +104,25 @@
 
 - (void)keyDown:(NSEvent *)e
 {
+  /*TODO, note that this isn't really "key down", rather it's "character entered"
+	or similar - if the key is held down long enough to repeat, we get multiple keyDowns
+   before a keyUp, and we just send them all along to the DasherCore code...*/
+  NSString *chars = [e characters];
+  if ([chars length] > 1)
+    NSLog(@"KeyDown event for %i chars %@ - what to do? Ignoring all but first...\n", [chars length], chars);
+  int keyCode = _keyboardHelper->ConvertKeyCode([chars characterAtIndex:0]);
+  if (keyCode != -1)
+    [dasherApp aquaDasherControl]->KeyDown(get_time(), keyCode);
+}
+
+- (void)keyUp:(NSEvent *)e
+{
+  NSString *chars = [e characters];
+  if ([chars length] > 1)
+    NSLog(@"KeyUp event for %i chars %@ - what to do? Ignoring all but first...\n", [chars length], chars);
+  int keyCode = _keyboardHelper->ConvertKeyCode([chars characterAtIndex:0]);
+  if (keyCode != -1)
+    [dasherApp aquaDasherControl]->KeyUp(get_time(), keyCode);
 }
 
 - (void)circleCallbackCentrePoint:(NSPoint)aCentrePoint radius:(float)aRadius outlineColorIndex:(int)anOutlineColorIndex fillColourIndex:(int)aFillColourIndex shouldFill:(BOOL)shouldFill lineWidth:(int)aLineWidth {
@@ -245,6 +264,7 @@
     [self blankCallback];  
   }
   
+  _keyboardHelper = new CKeyboardHelper();
   return self;
 }
 
@@ -279,11 +299,6 @@
   return YES;
 }
 
-- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
-{
-  return YES;
-}
-
 - (void)awakeFromNib
 {
 //  aquaDasherScreen = new COSXDasherScreen(self);
@@ -305,7 +320,7 @@
 
 - (BOOL)acceptsFirstResponder
 {
-  return NO;
+  return YES;
 }
 
 

Modified: trunk/Src/MacOSX/English.lproj/Preferences.nib/classes.nib
==============================================================================
--- trunk/Src/MacOSX/English.lproj/Preferences.nib/classes.nib	(original)
+++ trunk/Src/MacOSX/English.lproj/Preferences.nib/classes.nib	Thu Mar 12 14:46:50 2009
@@ -1,12 +1,37 @@
-{
-    IBClasses = (
-        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
-        {
-            CLASS = PreferencesController; 
-            LANGUAGE = ObjC; 
-            OUTLETS = {panel = NSPanel; }; 
-            SUPERCLASS = NSObject; 
-        }
-    ); 
-    IBVersion = 1; 
-}
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+<plist version="1.0">
+<dict>
+	<key>IBClasses</key>
+	<array>
+		<dict>
+			<key>ACTIONS</key>
+			<dict>
+				<key>makeKeyAndOrderFront</key>
+				<string>id</string>
+			</dict>
+			<key>CLASS</key>
+			<string>PreferencesController</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>OUTLETS</key>
+			<dict>
+				<key>panel</key>
+				<string>NSPanel</string>
+			</dict>
+			<key>SUPERCLASS</key>
+			<string>NSObject</string>
+		</dict>
+		<dict>
+			<key>CLASS</key>
+			<string>FirstResponder</string>
+			<key>LANGUAGE</key>
+			<string>ObjC</string>
+			<key>SUPERCLASS</key>
+			<string>NSObject</string>
+		</dict>
+	</array>
+	<key>IBVersion</key>
+	<string>1</string>
+</dict>
+</plist>

Modified: trunk/Src/MacOSX/English.lproj/Preferences.nib/info.nib
==============================================================================
--- trunk/Src/MacOSX/English.lproj/Preferences.nib/info.nib	(original)
+++ trunk/Src/MacOSX/English.lproj/Preferences.nib/info.nib	Thu Mar 12 14:46:50 2009
@@ -1,16 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
-	<key>IBDocumentLocation</key>
-	<string>63 445 356 240 0 0 1680 1028 </string>
 	<key>IBFramework Version</key>
-	<string>482.0</string>
+	<string>677</string>
+	<key>IBLastKnownRelativeProjectPath</key>
+	<string>../Dasher.xcodeproj</string>
+	<key>IBOldestOS</key>
+	<integer>5</integer>
 	<key>IBOpenObjects</key>
 	<array>
-		<integer>14</integer>
+		<integer>660</integer>
 	</array>
 	<key>IBSystem Version</key>
-	<string>8R218</string>
+	<string>9G55</string>
+	<key>targetFramework</key>
+	<string>IBCocoaFramework</string>
 </dict>
 </plist>

Copied: trunk/Src/MacOSX/KeyboardHelper.cpp (from r3663, /trunk/Src/Win32/KeyboardHelper.cpp)
==============================================================================
--- /trunk/Src/Win32/KeyboardHelper.cpp	(original)
+++ trunk/Src/MacOSX/KeyboardHelper.cpp	Thu Mar 12 14:46:50 2009
@@ -1,12 +1,18 @@
-#include "Common\WinCommon.h"
 #include "KeyboardHelper.h"
+#define KEYCODE_UP 63232
+#define KEYCODE_DOWN 63233
+#define KEYCODE_LEFT 63233
+#define KEYCODE_RIGHT 63234
 
+/* TODO: This file essentially the same as the Win32 code - 'twas copied from there, and
+   only very slightly modified. Even the Win32 code contained the comment:
 // TODO: This is essentially the same as the GTK code - should probably share them a little more
+  so we should really combine all three---
+  i.e. put some kind of KeyboardHelper into DasherCore, or refactor interpretation of keycodes.
+*/
 
 CKeyboardHelper::CKeyboardHelper() {
-  // TODO: Hard code the mappings for now, but eventually make these
-  // configurable (at which point we shouldn't need to know about the
-  // GDK constants.
+  // TODO: Hard code the mappings for now (slightly differently to Win32!)
 
   // 1 = E
   // 2 = N
@@ -15,31 +21,35 @@
 
   // Left of keyboard
 
-  m_mTable[0x41] = 1; //a
-  m_mTable[0x53] = 3; // s
-  m_mTable[0x57] = 2;// w
-  m_mTable[0x5a] = 4;// z
+  m_mTable['a'] = m_mTable['A'] = 1; //a
+  m_mTable['s'] = m_mTable['S'] = 3; // s
+  m_mTable['w'] = m_mTable['W'] = 2;// w
+  m_mTable['z'] = m_mTable['Z'] = 4;// z
 
   // Right of keyboard
 
-  m_mTable[0x4a] = 1; // j
+  m_mTable['j'] = m_mTable['J'] = 1; //a
+  m_mTable['k'] = m_mTable['K'] = 3; // s
+  m_mTable['i'] = m_mTable['I'] = 2;// w
+  m_mTable['m'] = m_mTable['M'] = 4;// z
+/*  m_mTable[0x4a] = 1; // j
   m_mTable[0x4b] = 3; // k
   m_mTable[0x49] = 2; // i
   m_mTable[0x4d] = 4; // m
-
+*/
   // Arrows
 
-  m_mTable[VK_LEFT] = 1;
-  m_mTable[VK_RIGHT] = 3;
-  m_mTable[VK_UP] = 2;
-  m_mTable[VK_DOWN] = 4;
+  m_mTable[KEYCODE_LEFT] = 1;
+  m_mTable[KEYCODE_RIGHT] = 3;
+  m_mTable[KEYCODE_UP] = 2;
+  m_mTable[KEYCODE_DOWN] = 4;
 
   // Arrows on numeric keypad
-
-  m_mTable[VK_NUMPAD4] = 1;
+  //TODO, don't have one on my MacBook, so not sure what codes to use!
+  /*m_mTable[VK_NUMPAD4] = 1;
   m_mTable[VK_NUMPAD6] = 3;
   m_mTable[VK_NUMPAD8] = 2;
-  m_mTable[VK_NUMPAD2] = 4;
+  m_mTable[VK_NUMPAD2] = 4;*/
 
   // Numbers
 
@@ -50,7 +60,7 @@
 
   // 0 = keyboard start/stop
 
-  m_mTable[VK_SPACE] = 0;
+  m_mTable[' '] = 0;
 }
 
 int CKeyboardHelper::ConvertKeyCode(int iCode) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]