Bug fixing and prep-work for IME support (along with refactored text input in general).
parent
f3316f8aa2
commit
5caa7a465e
|
|
@ -213,7 +213,7 @@ MASK LLKeyboardMacOSX::updateModifiers(const U32 mask)
|
|||
out_mask |= MASK_SHIFT;
|
||||
}
|
||||
|
||||
if(mask & MAC_CTRL_KEY || mask & MAC_CMD_KEY)
|
||||
if(mask & (MAC_CTRL_KEY | MAC_CMD_KEY))
|
||||
{
|
||||
out_mask |= MASK_CONTROL;
|
||||
}
|
||||
|
|
@ -267,7 +267,7 @@ MASK LLKeyboardMacOSX::currentMask(BOOL for_mouse_event)
|
|||
|
||||
if (mask & MAC_SHIFT_KEY) result |= MASK_SHIFT;
|
||||
if (mask & MAC_CTRL_KEY) result |= MASK_CONTROL;
|
||||
if (mask & MAC_ALT_KEY) result |= MASK_ALT;
|
||||
if (mask & MAC_ALT_KEY) result |= MASK_ALT;
|
||||
|
||||
// For keyboard events, consider Command equivalent to Control
|
||||
if (!for_mouse_event)
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ void removeGLView(GLViewRef view);
|
|||
// This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict)
|
||||
void callKeyUp(unsigned short key, unsigned int mask);
|
||||
void callKeyDown(unsigned short key, unsigned int mask);
|
||||
void callResetKeys();
|
||||
void callUnicodeCallback(wchar_t character, unsigned int mask);
|
||||
void callRightMouseDown(float *pos, unsigned int mask);
|
||||
void callRightMouseUp(float *pos, unsigned int mask);
|
||||
|
|
@ -104,6 +105,13 @@ void callHandleDragExited(std::string url);
|
|||
void callHandleDragUpdated(std::string url);
|
||||
void callHandleDragDropped(std::string url);
|
||||
|
||||
// LLPreeditor C bindings.
|
||||
std::basic_string<wchar_t> getPreeditString();
|
||||
void getPreeditSelectionRange(int *position, int *length);
|
||||
void getPreeditMarkedRange(int *position, int *length);
|
||||
void handleUnicodeCharacter(wchar_t c);
|
||||
void updatePreeditor(unsigned short *str);
|
||||
|
||||
NSWindowRef getMainAppWindow();
|
||||
GLViewRef getGLView();
|
||||
|
||||
|
|
|
|||
|
|
@ -332,7 +332,14 @@ NSWindowRef getMainAppWindow()
|
|||
return winRef;
|
||||
}
|
||||
|
||||
unsigned int getModifiers()
|
||||
/*
|
||||
GLViewRef getGLView()
|
||||
{
|
||||
return [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] glview];
|
||||
}
|
||||
*/
|
||||
|
||||
unsigned int getModifiers()
|
||||
{
|
||||
return [NSEvent modifierFlags];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,6 +211,11 @@ void callKeyDown(unsigned short key, unsigned int mask)
|
|||
gKeyboard->handleKeyDown(key, mask);
|
||||
}
|
||||
|
||||
void callResetKeys()
|
||||
{
|
||||
gKeyboard->resetKeys();
|
||||
}
|
||||
|
||||
void callUnicodeCallback(wchar_t character, unsigned int mask)
|
||||
{
|
||||
gWindowImplementation->getCallbacks()->handleUnicodeChar(character, mask);
|
||||
|
|
@ -370,6 +375,26 @@ void callQuitHandler()
|
|||
}
|
||||
}
|
||||
|
||||
std::basic_string<wchar_t> getPreeditString()
|
||||
{
|
||||
return gWindowImplementation->getPreeditor()->getPreeditString();
|
||||
}
|
||||
|
||||
void getPreeditSelectionRange(int *position, int *length)
|
||||
{
|
||||
gWindowImplementation->getPreeditor()->getSelectionRange(position, length);
|
||||
}
|
||||
|
||||
void getPreeditMarkedRange(int *position, int *length)
|
||||
{
|
||||
gWindowImplementation->getPreeditor()->getPreeditRange(position, length);
|
||||
}
|
||||
|
||||
void handleUnicodeCharacter(wchar_t c)
|
||||
{
|
||||
gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c);
|
||||
}
|
||||
|
||||
void LLWindowMacOSX::updateMouseDeltas(float* deltas)
|
||||
{
|
||||
if (mCursorDecoupled)
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ public:
|
|||
|
||||
void* getWindow() { return mWindow; }
|
||||
LLWindowCallbacks* getCallbacks() { return mCallbacks; }
|
||||
LLPreeditor* getPreeditor() { return mPreeditor; }
|
||||
|
||||
void updateMouseDeltas(float* deltas);
|
||||
void getMouseDeltas(float* delta);
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -2,10 +2,10 @@
|
|||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">12C60</string>
|
||||
<string key="IBDocument.SystemVersion">12D76</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.37</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">3084</string>
|
||||
|
|
@ -318,7 +318,7 @@
|
|||
<object class="NSWindowTemplate" id="110292814">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {1024, 768}}</string>
|
||||
<string key="NSWindowRect">{{196, 240}, {1024, 600}}</string>
|
||||
<int key="NSWTFlags">74974208</int>
|
||||
<string key="NSWindowTitle">Second Life</string>
|
||||
<string key="NSWindowClass">LLNSWindow</string>
|
||||
|
|
@ -328,13 +328,13 @@
|
|||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews"/>
|
||||
<string key="NSFrameSize">{1024, 768}</string>
|
||||
<string key="NSFrameSize">{1024, 600}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:20</string>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1200}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {2560, 1440}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">Second Life</string>
|
||||
<int key="NSWindowCollectionBehavior">128</int>
|
||||
|
|
@ -775,7 +775,7 @@
|
|||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">864</int>
|
||||
<int key="maxID">888</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
|
|
|
|||
Loading…
Reference in New Issue