Joined: Jun 19, 2003 Posts: 61 Location: Las Vegas
Posted: Tue Jan 13, 2004 7:42 am Post subject: Docking windows (paragraph style)
Hi
I'm having trouble docking the floating windows in neo office J. I have tried command dragging, option dragging, and command dragging and none of these seem to work. Does Neo/j use a different method for this??
From the subject of your posting, I assume that you are trying to dock the "Paragraph Styles" floating window. If so, this is not dockable because it isn't a real Mac OS X window.
NeoOffice/J (and OpenOffice.org 1.0.3 which NeoJ is based on), draws pictures of floating windows instead of creating real windows. You can tell if a floating window is one of these fake windows by dragging the window so that half of the window is in the document and half is not. If you can only see half of the window after doing this dragging, then it is a fake window.
Joined: Jun 19, 2003 Posts: 61 Location: Las Vegas
Posted: Wed Jan 14, 2004 11:00 pm Post subject:
Perhaps I mis-spoke. By docking I do not mean to make it drop into the apple "Dock", but rather to the side of the Open office window, the one that has the push pin symbol sometimes, just like the function list in calc.
Thanks for the clarification. I actually read the online help and tested this out and, sure enough, it works in OOo X11 but not in NeoJ.
I suspect that this is due to the old Mac OS X mouse right-click emulation. Since Mac OS X supports single button mice, pressing the Command key while clicking will send a right-click event to NeoJ.
This is one of the problems with using the Command key for all of the OOo shortcuts. We had a discussion about this many months ago in the testing forum. OOo uses the Control key and, if IIRC, we came to the conclusion that switching back to using the Control key for everything would be worse than having some of the Command-click features disabled.
Joined: May 31, 2003 Posts: 219 Location: French Alps
Posted: Fri Jan 16, 2004 2:15 pm Post subject:
NJ 0.7.1, patch-1
pluby wrote:
Thanks for the clarification. I actually read the online help and tested this out and, sure enough, it works in OOo X11 but not in NeoJ.
In my setup, both the stylist and the navigator pseudo-windows are anchored to the right border of the main window. I remember having to fight with Neo/J to get it, but I did. Believe it or not, I don't remember how! I'm no more able to change it. Maybe it was before the special keys mapping changed (see below). Maybe I cheated and copied the setting from the OOo config file (which one?).
pluby wrote:
I suspect that this is due to the old Mac OS X mouse right-click emulation. Since Mac OS X supports single button mice, pressing the Command key while clicking will send a right-click event to NeoJ.
This is one of the problems with using the Command key for all of the OOo shortcuts. We had a discussion about this many months ago in the testing forum. OOo uses the Control key and, if IIRC, we came to the conclusion that switching back to using the Control key for everything would be worse than having some of the Command-click features disabled.
Correct me if I'm wrong, but there is once again a confusion between the Control and Command key. On my setup the Ctrl key emulates the right click, not the Command (Apple). So Command-clicking should be used for the purpose of anchoring tools windows.
On a related matter I'm still unable to reproduce the ability to Open a Menu with a shortcut. As I mentioned in an other thread, I recently accidentally went to this behaviour, but I don't know how.
As Patrick often modifies the event loop management, some features might appear and vanishe, from patch to patch?
I looked at the code again and now I remember why none of these key-click combinations work: I ignore the key associated with the click. While this may seem like an oversight, I put this code in because Java uses the same flags for the following:
Alt key = right button
Command key = middle button
So, when NeoJ gets a mouse event, there is no way to tell if the user is pressing the Alt key are pressing the right button or is pressing both. The same situation applies to the Command and middle button. Hence, when NeoJ runs into either case, the flag is treated as a button flag, not a key flag. In other words, an Alt-click becomes a right-click with no key.
... I ignore the key associated with the click. ... In other words, an Alt-click becomes a right-click with no key.
Hi Patrick,
What about using the Shift key here ? Of course it's not perfect to add hotkeys that are not described in the online help, but on the other hand a useful feature could be lost.
OOo is already using Shift-Mouse in other places too, like for proportionally scaling a graphics, so it's not totally uncommon.
I would suggest changing vcl/source/window/dockwin.cxx and check for all occurences of IsMod1() which originally denotes the Control-Key. You could either OR it with a check for IsShift() or, as this situation cannot occur anyway as you stated, just replace all IsMod1()'s with IsShift().
(Un-)Docking would then be possible by performing Shift-Drag or Shift-Doubleclick.
You have given me an idea. I wrote some Java test code and found that I might be able to remap Java's built-in right-click and middle-click sequences so that Shift-click and Command-click are freed up for use by the OOo code.
Right-click would still be Control-click and middle-click would still be Alt-click. The only difference is that I can trap the key-pressed event for the Shift or Command key right before the mouse is pressed. Then, if the mouse button flags are set to button1 & (button2 || button3), I can ignore Java's mouse event and, instead, forward a button1 & (Ctrl || Shift) to the OOo code.
The key part of this approach is that when the user uses the key-click combination to emulate right-click and middle-click, Java leaves the button1 flag set. This, coupled with the preceding key pressed event is the signal that the user is really pressing button1 and is not actually pressing button2 or button3.
As long as OOo does not have any use for (Shift || Ctrl || Alt || Meta ) & (button2 || button3), this aproach should work. Do you know if these combinations are used by OOo?
Your approach sounds good to me and I cannot believe that OOo uses such awkward key-mousebutton-combinations like Control-RightClick or something. Although, you never know....
But there are definitely more places that would benfit from that change.
Perhaps you can post the final mapping of OOo vs. NeoOffice/J modifierkey-mousebutton combinations ? And also perhaps a list of impossible combinations, may be someone really finds one of them...
Last night I was able to enable the Shift-click and Command-click key combinations. As I mentioned to Stephan in my previous posting, Java gives me enough subtle hints about the key-click state that I was able to properly handle the above key combinations.
Ctrl-click is still mapped to a right-click and and Alt-click is still mapped to a middle-click.
I included the change in the lastest patch ("patch-8") in the NeoJ Testing forum in the "copy and paste" topic.
Stephan,
WRT the NeoJ key mapping list, I actually have not remapped any keys expect that Command = Ctrl and Ctrl = Meta. Fortunately, OOo's online help is XML based and contains the following conditional tag:
So, I was able to have "Command" display instead of "Control" in all online help and menus in NeoJ just by setting the following XML snippet in Neo's share/config/registry/instance/org/openoffice/Office/Common.xml file:
Code:
<System cfg:type="string">MAC</System>
The real problem (and it will be a recurring one on the Mac) is Apple is continually adding system shortcuts with each release. Their "reserved" shortcut keys are continually expanding even though it really messes up many applications. From what I have seen, no key combination is safe from being included in their system shortcut keys.
your patch works great, much better than locally using Shift as a replacement here... Having "Command" automatically appearing in the online help is really cool, however, when I looked up docking windows I still stumbled upon Ctrl strings in the section "Showing, Hiding and Docking Windows".
pluby wrote:
From what I have seen, no key combination is safe from being included in their system shortcut keys.
Patrick
WRT the NeoJ key mapping list, I actually have not remapped any keys expect that Command = Ctrl and Ctrl = Meta.
So all that is left is the original Alt-Key, or Mod2(), which is used to open menus (Alt-f for the File menu etc.) ... But as this is not working on the X11 version as well, I guess it's a common problem.
Oh, I just saw that Option+<key> generates special characters, but what about Ctrl ? Ok, may be too confusing... So there is no good solution, right ?
[So all that is left is the original Alt-Key, or Mod2(), which is used to open menus (Alt-f for the File menu etc.) ... But as this is not working on the X11 version as well, I guess it's a common problem.
Oh, I just saw that Option+<key> generates special characters, but what about Ctrl ? Ok, may be too confusing... So there is no good solution, right ?
I assume that you say my Alt key hack in the Java code. AFAIK, only the Alt and Shift keys are used by the Mac OS X keyboard input methods to compose characters. This, I suspect, is why the X11 version does not work either.
A solution that you might consider is to disable the Alt-key menu shortcuts for Mac OS X as it does not seem common for Mac OS X applications to support the menu traversal like you can in Windows. The only menu traversal that seems supported in most applications in with a native menu are use of the arrow keys which the OOo menus already support.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum