Scrolling Using Ctrl-W and Ctrl-Z lazarus / 61-Beginners ---------------------------------------------------------------------- Elap · 2015-08-08 18:37 I've just downloaded Free Pascal 2.6.4 and the editor works fine (ish) apart from Ctrl-W and Ctrl-Z which do nothing at all instead of scrolling. I downloaded 2.6.2 and it does the same (or rather, doesn't!). I'm using 32-bit Windows 7 Professional. Any ideas? ---------------------------------------------------------------------- jc99 · 2015-08-08 21:04 You are using the fp-ide ? I know Crtl-Z for Undo, What programs use these codes for scrolling ? ---------------------------------------------------------------------- Elap · 2015-08-08 22:11 I'm running fp.exe and using the Turbo 'compatible' editor. Undo is Alt-backspace. Ctrl-Z does nothing. ---------------------------------------------------------------------- rvk · 2015-08-08 22:33 CTRL+W and CTRL+Z don't do anything for me in fp.exe (v1.0.12 / FPC3.1.1). But what exactly is your question? ("Any ideas?" isn't exactly a question) ---------------------------------------------------------------------- Jurassic Pork · 2015-08-08 23:22 hello, Turbo pascal 7 : QuoteCursor Commands ---------------------------------------------------------------------- -------- [Left Arrow]   Left one character          [Right Arrow]  Right one Character [CTRL][A]      Left one word               [CTRL][F]      Right one word [Up Arrow]     Up one line                 [Down Arrow]   Down one line [CTRL][W]      Scroll up                   [CTRL][Z]      Scroll down [PG UP]        Page up                     [PG DN]        Page down [Home]         Go to the start of the line [End]          Go to the end of the line [CTRL][Q] [E]  Go to top of the screen     [CTRL][Q] [X]  Go to bottom of the screen [CTRL][Q] [R]  Go to top of the file       [CTRL][Q] [C]  Go to bottom of the file [CTRL][Q]   Go to start of the block    [CTRL][Q] [K]  Go to end of the block [CTRL][Q] [P]  Go to last cursor position free pascal ide editor isn't turbo pascal editor ---------------------------------------------------------------------- jc99 · 2015-08-09 07:21 Quote from: rvk on August 09, 2015, 12:33:14 amBut what exactly is your question? ("Any ideas?" isn't exactly a question) "Any ideas ?" Is a short question even when it's missing the verb. But you are right, it's not a very exact one.  I see two (maybe three) possible (exact) Questions here: 1. What does Ctrl-W and Ctrl-Z do in the free pascal ide editor ? 2. Is there a way to do scrolling with keyboard-commands in free pascal ide editor ? (3. Is there a way to configure the keyboard-shortcuts to the needs ? e.G: Scrolling up and down.) @JP: You are right free pascal ide editor isn't TP, but it aims to mimic for that. So TP-compatibility is a good question.  [Edit] PS: Lazarus and other "modern-Editors" use Ctrl- and ctrl- for Line-scrolling. ---------------------------------------------------------------------- Elap · 2015-08-09 08:02 OK, I'll rephrase it. According to the Free Pascal user guide, Ctrl-W and Ctrl-Z should perform scrolling functions as in the Turbo Pascal editor. They don't work; in fact they don't appear to do anything. Has this not been implemented in the Free Pascal editor, or is it affected by preferences somewhere, or what? Does it work for anyone? ---------------------------------------------------------------------- Jurassic Pork · 2015-08-09 11:02 may be not implemented : in the source file weditor.pas of the fp ide editor , i have not seen CTRL-W , CTRL-Z shortcuts : Code: [Select]const   FirstKeyCount = 46;   FirstKeys: array[0..FirstKeyCount * 2] of Word = (FirstKeyCount,     Ord(^A), cmWordLeft, Ord(^B), cmJumpLine, Ord(^C), cmPageDown,     Ord(^D), cmCharRight, Ord(^E), cmLineUp,     Ord(^F), cmWordRight, Ord(^G), cmDelChar,     Ord(^H), cmBackSpace, Ord(^J), cmExpandCodeTemplate,     Ord(^K), $FF02, Ord(^L), cmSearchAgain,     Ord(^M), cmNewLine, Ord(^N), cmBreakLine,     Ord(^O), $FF03,     Ord(^P), cmASCIIChar, Ord(^Q), $FF01,     Ord(^R), cmPageUp, Ord(^S), cmCharLeft,     Ord(^T), cmDelToEndOfWord, Ord(^U), cmUndo,     Ord(^V), cmInsMode, Ord(^X), cmLineDown,     Ord(^Y), cmDelLine, kbLeft, cmCharLeft, ---------------------------------------------------------------------- Elap · 2015-08-09 12:04 Jurassic Pork: Thanks for that - it confirms what I suspected. ---------------------------------------------------------------------- jc99 · 2015-08-10 22:47 You don't have to suspect anything, JP just pointed out, where to start. So you can implement it yourself. ...or use my patch, [edit] PS: if you use the fp.lpi - Project file, you have to add "..\compiler\systems" to the searchpath, otherwise i_bsd.pas is not found. ---------------------------------------------------------------------- jc99 · 2015-08-12 20:03 @Elap: A patch file is a text-File containing the changes, and where to change, if you want, you can do it manually. First you have to find the original weditor.pas file. Then there are only a few changes. First i had to create 2 new methods for scrollUp and ScrollDown, (line 643ff) Then i had to assign the keyboard-Commands ctrl-W and ctrl-Z to cmScrollDown and cmScrollUp.  (Line 812ff) Then these messages had to be bind to the New methods . (Line 3527ff ) At last the scrolling had do be done. (Line 4293ff ) ... That was all, now you have ctrl-W and ctrl-Z for scrolling. PS: lines starting with + have to be inserted, lines with - have to be deleted. ---------------------------------------------------------------------- Jurassic Pork · 2015-08-12 22:43 hello, jc99 thanks for your patch. I have recompiled fpc/ide with it, CTRL-W , CTRL-Z seems to be OK now. Strange thing : in the source file of turbo pascal 7 editor editors.pas , no code for CTRL-W  CTRL-Z : Code: [Select]{*******************************************************} {                                                       } {       Turbo Pascal Version 7.0                        } {       Turbo Vision Unit                               } {                                                       } {       Copyright (c) 1992 Borland International        } {                                                       } {*******************************************************} unit Editors; const   FirstKeys: array[0..37 * 2] of Word = (37,     Ord(^A), cmWordLeft, Ord(^C), cmPageDown,     Ord(^D), cmCharRight, Ord(^E), cmLineUp,     Ord(^F), cmWordRight, Ord(^G), cmDelChar,     Ord(^H), cmBackSpace, Ord(^K), $FF02,     Ord(^L), cmSearchAgain, Ord(^M), cmNewLine,     Ord(^O), cmIndentMode, Ord(^Q), $FF01,     Ord(^R), cmPageUp, Ord(^S), cmCharLeft,     Ord(^T), cmDelWord, Ord(^U), cmUndo,     Ord(^V), cmInsMode, Ord(^X), cmLineDown,     Ord(^Y), cmDelLine, kbLeft, cmCharLeft, but with the exec Turbo.exe CTRL-W and CTRL-Z work. Hidden source code ? other place ?  Friendly, J.P ---------------------------------------------------------------------- jc99 · 2015-08-13 05:49 Since cmScrollUp and cmScrollDown are standard definitions this is possible. Maybe in a BaseClass ... [edit] Maybe TP itself used an extended editor, not the standard TV-Editor, or a descendent of it.