I am not sure what the problem is. Your patch basically does what you say it's
doing wrong in 10.10, namely calling goToPreviousPage and goToNextPage. I don't
know why that is right or wrong? For one thing, it is not what it does no older
OS versions. It also depends on your PDF display settings, in particular
whether it's continuous or not. Moreover, as I said earlier, I find it very
hard to believe that Preview would behave any different from Skim in this
regards, because both are based on Apple's PDFKit, and this framework handles
these particular events; certainly in Skim, and I cannot imagine Preview would
override it, because they would have done that in the framework itself if they
thought it would be better. My guess actually is that you're comparing apples
to oranges, as in you're using different PDF view settings in Skim and Preview
(I know the default settings are different by default.)
Christiaan
On Aug 16, 2014, at 19:29, James Widman wrote:
> Hi all,
>
> Issue: in OS X 10.10 (14A314h), NSKeyDown events for the pagedown key and
> the space bar result in a call to goToPreviousPage, and pageup/shift-space
> result in a call to goToNextPage.
>
> I wrote a patch for this (below) but:
>
> - I’m a newbie with Skim’s source code (and Objective-C in general);
> - I’m not sure where keyboard bindings are normally supposed to happen; and
> - I’m not sure whether this is a bug in Yosemite (though Preview.app seems
> well behaved).
>
> Criticism welcome!
>
> —James
>
> Index: SKPDFView.m
> ===================================================================
> --- SKPDFView.m (revision 8385)
> +++ SKPDFView.m (working copy)
> @@ -1045,11 +1045,18 @@
> }
> } else {
> // Normal or fullscreen mode
> - BOOL isLeftRightArrow = eventChar == NSRightArrowFunctionKey ||
> eventChar == NSLeftArrowFunctionKey;
> - BOOL isUpDownArrow = eventChar == NSUpArrowFunctionKey || eventChar
> == NSDownArrowFunctionKey;
> - BOOL isArrow = isLeftRightArrow || isUpDownArrow;
> -
> - if ((eventChar == NSDeleteCharacter || eventChar ==
> NSDeleteFunctionKey) &&
> + BOOL const isLeftRightArrow = eventChar == NSRightArrowFunctionKey
> || eventChar == NSLeftArrowFunctionKey;
> + BOOL const isUpDownArrow = eventChar == NSUpArrowFunctionKey ||
> eventChar == NSDownArrowFunctionKey;
> + BOOL const isArrow = isLeftRightArrow || isUpDownArrow;
> + BOOL const haveShiftKey = !!(modifiers & NSShiftKeyMask);
> + BOOL const isPageDown = eventChar == NSPageDownFunctionKey ||
> eventChar == ' ' && !haveShiftKey;
> + BOOL const isPageUp = eventChar == NSPageUpFunctionKey ||
> eventChar == ' ' && haveShiftKey;
> +
> + if (isPageDown) {
> + [self goToNextPage:self];
> + } else if (isPageUp) {
> + [self goToPreviousPage:self];
> + } else if ((eventChar == NSDeleteCharacter || eventChar ==
> NSDeleteFunctionKey) &&
> (modifiers == 0)) {
> [self delete:self];
> } else if (([self toolMode] == SKTextToolMode || [self toolMode] ==
> SKNoteToolMode) && activeAnnotation && editor == nil &&
------------------------------------------------------------------------------
_______________________________________________
skim-app-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-develop