lancetw / welly

Automatically exported from code.google.com/p/welly
GNU General Public License v2.0
0 stars 1 forks source link

Unable to use Home/End/PgUp/PgDn if user customized KeyBinding #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. I want Home/End/PgUp/PgDown acts as they are on PC
2. So I've applied KeyFixer, which modifies 
~/Library/KeyBindings/DefaultKeyBinding.dict.  The 
fixer is available here: http://www.starryhope.com/tech/apple/2006/keyfixer/
3. After Welly has restarted, the events of these keys are ignored by Welly.

I've modified YLView.m to fix this "issue" (yes, Nally has this issue, too).  I 
think some people still 
want their Home/End/PgUp/PgDown keys acts as what they are on PC, so this fix 
is necessary.

And here is the diff:

Index: YLView.m
===========================================================
========
--- YLView.m    (revision 765)
+++ YLView.m    (working copy)
@@ -859,16 +859,20 @@
         ch[0] = 0x1B;
        [[self frontMostConnection] sendBytes:ch length:1];
 // } else if (aSelector == @selector(cancel:)) {
-   } else if (aSelector == @selector(scrollToBeginningOfDocument:)) {
+   } else if (aSelector == @selector(scrollToBeginningOfDocument:) ||
+              aSelector == @selector(moveToBeginningOfLine:)) {
         ch[0] = 0x1B; ch[1] = '['; ch[2] = '1'; ch[3] = '~';
        [[self frontMostConnection] sendBytes:ch length:4];     
-   } else if (aSelector == @selector(scrollToEndOfDocument:)) {
+   } else if (aSelector == @selector(scrollToEndOfDocument:) ||
+              aSelector == @selector(moveToEndOfLine:)) {
         ch[0] = 0x1B; ch[1] = '['; ch[2] = '4'; ch[3] = '~';
        [[self frontMostConnection] sendBytes:ch length:4];     
-   } else if (aSelector == @selector(scrollPageUp:)) {
+   } else if (aSelector == @selector(scrollPageUp:) || 
+              aSelector == @selector(pageUp:)) {
        ch[0] = 0x1B; ch[1] = '['; ch[2] = '5'; ch[3] = '~';
        [[self frontMostConnection] sendBytes:ch length:4];
-   } else if (aSelector == @selector(scrollPageDown:)) {
+   } else if (aSelector == @selector(scrollPageDown:) ||
+              aSelector == @selector(pageDown:)) {
        ch[0] = 0x1B; ch[1] = '['; ch[2] = '6'; ch[3] = '~';
        [[self frontMostConnection] sendBytes:ch length:4];     
    } else if (aSelector == @selector(insertTab:)) {

Original issue reported on code.google.com by duckste...@gmail.com on 24 Nov 2009 at 2:29

GoogleCodeExporter commented 9 years ago
"Acts like on PC" means:

Home: Move to beginning of line
End: Move to end of line
PageUp: Move one page up within the textarea
PageDown: Move one page down within the textarea

All actions above are by default affected to the scrollable panel, not to the 
textarea.

Original comment by duckste...@gmail.com on 24 Nov 2009 at 2:33

GoogleCodeExporter commented 9 years ago
fixed in r791. Thanks ducksteven!

Original comment by talent...@gmail.com on 14 May 2010 at 3:57