Hello!
My app is a kind of remote desktop controller. I'm encountering some problems
and wondering which solutions are in the MBS plugin (as well as knowledge as
why some behaviours are as they are). For now, I've made a Mac and Win32
version; Linux is planned to be supported, but it hasn't started yet (so I
don't know which bugs I'll encounter there).
On Win32, I use the RemoteControlMBS.WinVirtualKeyForASCII function, followed
by RemoteControlMBS.WinVirtualKeyCodeToScanCode and finally
RemoteControlMBS.WinPressKey. However, some keys don't work (arrow keys, or
delete, for instance, but there are numerous failing keys). I'm not sure at
which stage the problem arises (are the given key codes correct or the PressKey
fails?), but I've made a test app, pressing keys from 0 to 300 (i.e. way too
high) and no value produces delete, arrow keys or the other ones which fail.
I'm thinking WinPressKey is the problem, then.
On Mac, most keys work; however, I've had to make a “select case” for the arrow
keys and the “o” key (strange for the “o” key; “O” is recognised just fine, as
are all the other characters…) since they all fail to be recognised by
RemoteControlMBS.MacTextForKeyCode(i,3,j) (I've made like the example, with a
loop, testing all key modifiers combinations).
Anyway, the biggest problem I'm having on the Mac side is with the mouse. I can
move the mouse remotely (I see it moving as well on the remote computer), but
it's like if the applications won't notice the move (e.g. the Dock doesn't show
the name of the app the mouse is over, menu items aren't highlighted until I
actually click on them or the screen saver does not vanish with mouse moves).
Another problem with the mouse on the Mac side is with moving windows or other
drag operations: I send MouseDown, MouseDrag and MouseUp events correctly, but
dragged items won't update their positions until I release the mouse (so you
don't see the window or dragged items being moved until the MouseUp happens).
Next, I'd ideally want to catch as much keys as possible: for remote
controlling, this is almost a requirement. I've problems with these:
•Command-Tab (this one is mandatory)
•Command-H: I can't seem to hide, disable or change the “Hide me” and “Hide
others” menu items' shortcut. The “Quit” menu item has the same problem, but I
have a workaround to catch it otherwise. “Hide me” and “Hide others” are caught
earlier than Xojo events.
•Command-Option-Esc (force quit) and Command-Option-D (show/hide the Dock)
would be good additions, as well as much possible shortcuts.
•The Windows key to show the Windows menu (widely used, so it's an important
one)
•Windows-R and other Windows-related combinations; I can't even figure out how
to catch a Windows key.
For Command-Tab, I tried several things, like a CarbonHotKeyMBS (not caught)
and NSEventMBS seem to imply one cannot handle global events (which I assume
Command-Tab is). On the Internet, I found one suggestion about using Event
Traps (I don't know how to use it) and one piece of code:
#import <Carbon/Carbon.h>
void *oldHotKeyMode;
- (void)windowDidBecomeKey:(NSNotification *)notification{
oldHotKeyMode
= PushSymbolicHotKeyMode(kHIHotKeyModeAllDisabled);
}
- (void)windowDidResignKey:(NSNotification *)notification{
PopSymbolicHotKeyMode(oldHotKeyMode);
}
but that's Chinese to me.
Thanks for any idea.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info