Difference between revisions of "Dmuse: Key commands"
Line 119: | Line 119: | ||
There are two mouse shortcuts to loading and storing windows. Under the "File" title, "Load" has the same effect as KeyPad (+). "Save" has the same effect as the combination KeyPad <shft> (+) followed by the dollar sign. In other words, it can only save the window back to its source, not to another file. | There are two mouse shortcuts to loading and storing windows. Under the "File" title, "Load" has the same effect as KeyPad (+). "Save" has the same effect as the combination KeyPad <shft> (+) followed by the dollar sign. In other words, it can only save the window back to its source, not to another file. | ||
− | == Clearing a window | + | == Clearing a window == |
− | KeyPad <shft> (-) | + | <center> |
+ | {| class="wikitable" cellpadding="5" cellspacing="0" border="1" style="width:700px" | ||
+ | ! scope="col" width="100px" | Key sequence | ||
+ | ! scope="col" width="600px" | Description | ||
+ | |- | ||
+ | | KeyPad(-) ||| clear only the current line to the right of cursor. | ||
+ | |- | ||
+ | | <shft>KeyPad(-) || clear a window to the right and below the cursor. | ||
+ | |} | ||
+ | </center> | ||
− | The | + | Material cleared in this way cannot be retrieved. Clearing a window has NO EFFECT on files. The source file, if there be one, is unaffected. |
+ | |||
+ | <center> | ||
+ | {| class="wikitable" cellpadding="5" cellspacing="0" border="1" bgcolor="#aaffaa" style="background:#aaffaa; width:700px" | ||
+ | ! scope="col" width="150px" | Menu sequence | ||
+ | ! scope="col" width="550px" | Description | ||
+ | |- | ||
+ | | File->Clear || move the cursor to Home (line 1, column 1) and clear the window <nowiki>[<shft>KeyPad(-)]</nowiki> | ||
+ | |} | ||
+ | </center> | ||
== Searching a window == | == Searching a window == |
Revision as of 06:48, 3 October 2010
Contents
- 1 Introduction to the Keyboard command list in Dmuse
- 2 Keyboard command list in Dmuse
Introduction to the Keyboard command list in Dmuse
After an initial splash screen, Dmuse presents to the user an empty text-editing window. What you see is a view of one out of thirty possible edting windows. You will see a blinking cursor in the upper left-hand corner of the screen. The arrow keys to move the cursor anywhere within the window. The metaphor here is a blackboard: as you can write anywhere on the blackboard with a piece of chalk, you can write (type) anywhere on a Dmuse window. In this respect, Dmuse does not work like most text processors which contain empty lines that are filled with content from left to right.
The Dmuse interface makes extensive use of the keyboard with numerous combinations of the <shft>, <ctrl>, and <alt> keys. Since the layout and response for the PC-Linux and Macintosh keyboards is slightly different (e.g., the Mac has no Insert key), there are some differences between the PC-Linux and Mac versions of the command list. The Dmuse documentation is designed to take this into account; so that if you are running the Mac version of Dmuse, all of the internal documentation will correspond to that version. For purposes of this document, the following descriptions will be for the PC-Linux version of Dmuse. Every keystroke combination in the PC-Linux version has a corresponding keystroke combination for the Mac.
Commands for moving the cursor and viewing the window.
The first thing to note is the difference between a "window" and the "screen". Using the metaphor above, a "window" is the full blackboard; the "screen" is a view of a portion of that window. Windows in Dmuse can be quite large; up to 960 columns, and up to one million lines of text. The screen size is whatever fits into the X-window you have set up for Dmuse (changeable by your computer's window manager). Here are some commands for moving the cursor and viewing windows:
Key sequence | Description |
---|---|
arrow keys | move the cursor. |
<ctrl> arrows, or <right-shft> arrows |
scroll the contents of a window up, down, left and right. |
PageUp/Down | shift the view of the window up or down by one page. Note, shifting the view of a window up by one page(PageUp) is the same as scrolling the contents of the screen down by one page. |
Home | put cursor at top of window (line 1, column 1). |
End | put cursor below last line of text in window and in column 1. |
KeyPad digits | change between windows 0 through 9. |
<ctrl> KeyPad digits | access windows 10 to 19. |
<alt> KeyPad digits | access windows 20 to 29. |
KeyPad dot | toggle between current and previous windows. <shft><esc> (for LapTops) will do this also. |
The mouse
Dmuse developed initially as a keyboard only interface, with the mouse being added much later. So the mouse does not do many of the things most users expect. This section describes what the mouse does do; the next section describes some of keystrokes that provide the functionality you would expect from a mouse (but do not get with Dmuse).
- Across the bottom frame of Dmuse you will see the numbers 0 to 29. Click on one of these to change to that window. There is also a question mark on that frame. Click on that and you will get a summary description of what is in each of the windows (since it is sometimes hard to remember what you have put where).
- Click on the word "Window" in the top frame to toggle between windows (same as KeyPad dot). Click anywhere else in the top frame to call up the resident file manager.
- Along the right frame is something that looks like a scroll bar. It is not a real scroll bar, but you can click in different places along the "track" to shift the view to different places in the window. The real purpose of the pseudo scroll bar is to show you approximately where you are in a window. It is not uncommon for a window to contain thousands of lines, and in this case you would like to know if you are somewhere near the top or near the bottom of a window. At the right-hand side of the top frame are two numbers representing the current position of the cursor in the window: line number and column number.
- If you activate the resident file manager (F4), the mouse can be used to select various commands for this sub-program.
- Finally, if you click anywhere in the main screen, the cursor will go there.
Keystrokes that highlight, and what you can do with highlighted material.
With many programs the mouse is used to highlight text. This requires the "hold and drag" motion of the mouse, something Dmuse does not currently do. Instead, Dmuse has the following keystrokes to highlight areas of the window. In Dmuse, there are two kinds of highlight: box highlight and line highlight.
Box highlighting commands
Key sequence | Description |
---|---|
<left-shft> arrows | box highlight a region of the window. |
<ctrl><shft> arrows | move box selection around window. After contents have been moved, any other keystroke will deposit content of the box in its new location, overwriting whatever was there on the screen. |
<ctrl>Insert | load contents of box into the "box buffer." There is only one box buffer, so whatever was previously in the box buffer will be replaced. |
<shft>Insert | copy contents of box buffer to the screen at cursor location. The box buffer is universal to all Dmuse windows, so you can use the box buffer to copy material from one window to another. Copying from the box buffer does not change the contents of the buffer. |
Delete | delete window region covered by the highlight. Anything to the right of deleted material moves left. |
minus, or underscore |
draw single or double line around the edge of the box. You can use this facility to build up complicated line patterns and templates. |
tilde | used with the box highlight, the tilde key will remove any line characters around the edge of the highlighted area. |
t | if you are highlighting a column of numbers, push "t" to get a total at the bottom. |
a | if you are highlighting two columns of numbers side by side, push "a" to get a third column which is the sum. Be sure your highlight includes space for the third column of numbers. |
s | push "s" to get a third column which is the difference between the two columns. If your columns contain commas, you will get commas in your answer; and if one of your numbers has a dollar sign, you will get a dollar sign in your answer. (works with pounds and yen, too). |
line highlighting commands
The second type of highlight is the line highlight. To get the line highlight, hold down the <left-shft> key and use the PageDown or arrow-down key. <left-shft> PageUp and arrow-up in this situation can be used to reduce the number of lines highlighted but not to start a line highlight. With lines highlighted, you have the following options.
- Use the Delete key to delete lines to the line buffer.
- Use the Insert key to copy lines to the line buffer. Lines will not be deleted in this case.
The line buffer does not work like the box buffer. It is a last-in, first-out trash heap. And its size is limited only by the size of your disk! The command <shft><alt>Insert will retrieve the last "block" of lines put the line buffer, whatever number of lines that was, and insert them into your current window just above the cursor. The command <ctrl><shft>Insert will do the same thing, but will copy instead of retrieve the lines from the line buffer. You can use <ctrl><shft>Insert multiple times to copy the same group over and over again.
If <shft><alt>Insert is used more than once, it will continue to retrieve lines from the line buffer (trash heap), but only one line at a time. The line buffer works across all windows, so you can use this feature to move material between windows.
You can delete lines to the trash heap without using the line highlight. <alt>Delete deletes a line to the trash heap. <shft><alt>Delete copies a line to the trash heap but does not delete it. Instead, the cursor moves down one line. Thus, holding down <shft><alt> and pushing Delete several times will copy several lines (one at at time) to the trash heap. Holding down <shft><alt> and pushing Delete and Insert in alternation will copy the same line over and over again.
Note: We normally use the line highlight method to delete or copy lines. Not only does this allow groups of lines to be deleted/copied, but also for safety reasons it is helpful to SEE what you are deleting BEFORE you delete it. Note also that all lines deleted in this way can always be recovered at least once. The trash heap never goes away, but the top layer can be removed. There are two other commands that delete lines (covered below), which do not put deleted material on the trash heap. Material delete by those commands goes away completely (from the window, anyway).
Loading and storing files.
Key sequence | Description |
---|---|
KeyPad(+) | load a file to the current window, at the line the cursor is currently on. |
<shft> KeyPad(+) | store contents of the current window (the entire contents) to a file. |
It is very important to make a distinction between the contents of a window and the contents of a file that might have the source for that window. First of all, any changes to the contents of the window are NOT reflected in the file unless and until the window is stored back to the file. Second, if a file is loaded into a window anywhere below the top line, the window and the file will be different right away. Dmuse provides a flag in the top frame, which signals when the contents of a window is different from the file which was its source (if there was one). If a file is loaded into a window (at any location), the top frame contains the name of the source file. If a window was not loaded from a file, no source is specified.
When you type KeyPad (+), you will be asked for the name of the file to load. If you respond with a dollar sign, you will be asked for the name again, and the file will be displayed as a Hex dump (handy for looking as such things as MIDI files).
When you type <shft>KeyPad(+), you will be asked for the name of the file to which the window is to be stored. If you type a dollar sign ($), the window will be stored back to the file from which it was last loaded (as noted in the top frame). When a window is stored to a file, the contents of the window and the file are the same, and the "difference flag" in the top frame goes off.
You can load one window from another by typing KeyPad (+) and then giving "*<number>" as the name of the file to load, <number> being the number of the source window. A window loaded in this way has no "source" per se.
There are two mouse shortcuts to loading and storing windows. Under the "File" title, "Load" has the same effect as KeyPad (+). "Save" has the same effect as the combination KeyPad <shft> (+) followed by the dollar sign. In other words, it can only save the window back to its source, not to another file.
Clearing a window
Key sequence | Description |
---|---|
KeyPad(-) | clear only the current line to the right of cursor. |
<shft>KeyPad(-) | clear a window to the right and below the cursor. |
Material cleared in this way cannot be retrieved. Clearing a window has NO EFFECT on files. The source file, if there be one, is unaffected.
Menu sequence | Description |
---|---|
File->Clear | move the cursor to Home (line 1, column 1) and clear the window [<shft>KeyPad(-)] |
Searching a window
You can search for a string in a window by type KeyPad (/). You will be prompted for the search string. If you type down-arrow, you will be presented with a choice of the last 10 search strings you have entered. This allows you to redo former searchs without having to retype the strings. The F11 function key repeats the same search to the right and below the cursor. The F12 function key does the same to the left and above the cursor.
What else?
Key sequence | Description |
---|---|
Insert | toggles between insert and overstrike mode. A plus sign (+) appears in the top frame when you are in insert mode. |
Delete | delete character; move the rest of the line one column to the left. |
Backspace | back the cursor up one column and replace whatever is there with a "space". |
<alt> left-arrow | move the cursor one word to the left. If there are no more words to the left, the cursor will jump back a line to the last word on that line. |
<alt> right-arrow | move the cursor one word to the right. If there are no more words to the right, the cursor will jump to the first word on the next line. |
<return> | put the cursor at the beginning of the next line. This requires some discussion. On many text processors, the text is stored as a stream of characters, and the <return> character signals the end of a paragraph. Dmuse treats each line on the screen as a separate record. When a window is stored to a file, a <return><line-feed> character combination is attached automatically to the end of each line. When a file is loaded to a window, these "record delimiter" characters are simply removed and each record appears on a new line. |
Now a word about "record delimiters" for you Linux users. The use of the character combination <return><line-feed> as a record delimiter originated with IBM computers, and was adopted early on by Microsoft. Linux grew out of the old AT&T Unix system, which used only the <line-feed> character as a record delimiter. Linux recognizes both systems, but some Linux applications (some versions of makefiles for example), still expect to see only the <line-feed> character, and will treat the <return> character as part of the text of a line. Being able to handle both systems is therefore a priority. Dmuse provides a way to do this. If you load a file that uses only the <line-feed> character as a record delimiter, a flag will appear in the right-hand portion of the top frame. If you later store this file, it will be stored using only the <line-feed> character as a delimiter. You can toggle the delimiter flag using the keysrokes <ctrl><shft>KeyPad-(*). When the flag is off, the record delimiter will revert to <return><line-feed>. Thus you can load a file in one format, and store it in another.
Key sequence | Description |
---|---|
<shft> return | puts an actual carriage-return character at the end of the line and puts the cursor on the next line. |
<alt> return | puts the cursor on the next line and below the first (non-blank) character in the previous line |
Tab | moves the cursor to the next tab or to the next line. |
<left-shft> Tab | moves the cursor backward to the previous tab or to the last tab on the previous line. |
<ctrl> Tab | sets (or removes) a tab position at the cursor location. |
<shft><ctrl> Tab | removes all tabs |
<F10> | Toggle button to see where tabs are set. |
Tabs also require some discussion. In some Linux applications (again, makefiles are an example), the Tab character is an important delimiter. It must be present for the file to be read properly. When Dmuse loads a file, it treats the Tab character like a text character. Yes, the Tab has its own character in Dmuse, which can be entered by typing <shft><alt>0. This means two things: (1) the Tab is not expanded, and (2) such files can be edited correctly by Dmuse. If you want the Tab expanded, you need to use the command <ctrl><KeyPad-(+)> to load the file. But use caution here. In expanding the Tab character, you may lose it. Or you may lose space characters before a Tab. In the end, for files like this, we recommend using another editor entirely.
Wordwrap
Most text processors use wordwrap automatically. In fact, you cannot disable wordwrap on most text processors. You cannot put the cursor beyond the end of a line, because the line, itself, is not a separate entity. Wordwrap has meaning only when there are right and left margins. For most text processors, these margins are the right and left limits of the window you are typing in. Change the horizontal size and you change the margins .
Dmuse has wordwrap as an advanced feature. But, as you can imagine, this can only work within limits. The first limits are the margins, themselves. Wordwrap works only when the cursor is between the legal margins. When the cursor is outside the margins, you can still type text, but whatever you type might disappear if the margins are changed, so be careful.
Toggle the F10 function button to see where the margins are set. <left-shft><alt> right and left arrow will move the left margin. <right-shft><alt> right and left arrow will move the right margin. <ctrl><shft> right and left arrow will move both margins simultaneously. The default action is for margins to move only for the paragraph the cursor is in. You can change this default using the <ctrl> F10 function key.
Dmuse is initially provided with wordwrap disabled. You can activate it using the F9 function button. When wordwrap is enabled, the KeyPad (*) key toggles it on and off. When wordwrap is "on," you will see the wordwrap flag [W] on the right-hand side of the top frame. We rarely work with wordwrap on, but we do use it to reformat (change the horizontal size of) paragraphs.
When wordwrap is on, the keystrokes <return>, <insert> and <delete> behave differently. This difference is documented internally in Dmuse and will not be discussed here.
The margins have meaning even when wordwrap is off. If the cursor is in the middle of a group of sentences, each starting at the left margin, the command <ctrl> p will reformat the sentences into a single paragraph. Likewise, if the cursor is in the middle of a paragraph, the command <ctrl> s will reformat the paragraph into a set of sentences, each starting at the left margin. For these commands to work properly, all text must be to the left of the right margin.
Connect mode
Dmuse starts out as a simple screen editor. You can activate the connect mode feature using the F9 function key. Once you activate this feature, it stays activated for all future Dmuse sessions until you deactivate it.
The KeyPad <shft> (*) keystroke toggles connect mode. When you enter connect mode, Dmuse responds with the message, "Ready for program," and the connect mode flag [*] comes on in the top frame. Connect mode is window dependent, that is, each window has its own connect mode state.
When a window is in connect mode, you can type anything you want and put the cursor anywhere you want. Nothing happens until you type <return>. When you do that, Dmuse reads whatever is on that line, regardless of how it got there, and sends this to the connect portion of the program. The program at this point expects one of three things:
- the name of a specified program that you want to run. This must be a Zbex program, and it must be in a pre-specified library (see the section init files for how to do this).
- the command "zz" which invokes the Zbex compiler and interpreter (see the section of Running zbex programs for how this works).
- "&&" followed directly by a bash-shell command. For a limited number of commands, this will direct the command to the operating system, with the output from the command being direct back to the Dmuse window you are in. This works especially well for commands like "man", since you can easily scroll through the entire output, and even grab portions of it to put in other windows -- even make your own documentation files.
The most important point here, and what makes Dmuse different from most other interfaces, is that it doesn't matter how or when something got put on the screen. If you type return, the entire line gets read and sent to the program. The Zbex language has an instruction, getc, which works the same way. When executing a getc, Zbex waits -- does not listen to what you type -- does not care if you change windows, insert or delete lines, move the cursor, whatever. It simple waits for you to type <return>, and when you do, it reads the line the cursor is currently on and sends this to the program.
Keyboard command list in Dmuse
Dmuse has a utility called "Keystrokes" which can be called either from the "Help" menu or with the keystroke command <ctrl>F1. Once you enter this utility, each key you press on your computer keyboard returns a complete description of what that keystroke does, including all combinations with <shft>, <ctrl>, and <alt>. The only way to exit this utility is to push the Esc key twice. Listed below are some of the most important and useful keystrokes.
Key sequence | Description |
---|---|
Esc | Open dialog box for extended keystrokes. This is mainly for LapTops, where the keyboard does not include the KeyPad. Esc is also used to escape from various dialog boxes and sub-programs. |
<shft>Esc | Toggle between the current window and the previous window. |
<ctrl>Esc | (on the Macintosh) = <ctrl>Break (PC-Linux) |
<shft><ctrl>Esc | (on the Macintosh) = <shft>PrintScreen (PC-Linux) |
F1 | Introduction to help |
<shft>F1 | Toggle between the current window and the HELP window. The HELP window must first be loaded from the Help menu. |
<ctrl>F1 | Editor Keystrokes utility |
F2 | Activate the top panel with the five pulldown menus. Once the panel is activated, the cursor arrows can be used to move between choices. Make a choice with the Enter key. Esc will exit the panel. The mouse can also be used to activate the panel and make a choice. |
<ctrl><shft>F2 | EXIT Dmuse |
<shft>F2 | Store the state of Dmuse in a personal default file and EXIT Dmuse |
<ctrl>F2 | Store the state of Dmuse in a project file you specify and EXIT Dmuse |
F3 | Move the cursor to a specified line number in the current window. |
<ctrl>F3 | Check window data structure. If for some reason you think Dmuse is behaving badly, use this command. If the data structure is corrupted, Dmuse will tell you and will try to fix itself. For safety reasons, you should then save important work and exit Dmuse. Note: Dmuse is quite stable, but ... well, as they say in Islam, only Allah is perfect. |
F4 | Activate the resident file manager. |
F5 to F8 | These function keys control screen display colors. There are 16 possible combinations of foreground and background colors in Dmuse. These can be referenced by the four function keys, F5, F6, F7, and F8 in their <unaltered>, <shft>, <ctrl>, and <ctrl><shft> states. In normal typing mode, if you push, say <ctrl>F6, everything you then type (in your current window) will appear in color combination 10. Each window keeps track of its own current color combination. The 16 possible combinations are specified in your init file (read by Dmuse when it first starts up). If you have used the <shft> arrow keys to highlight a (box) section of the screen, then pushing, say <ctrl>F6, will switch that area of the screen to color combination 10 (normal typing is not changed). By convention F5 switches to the default color combination. |
F9 | Change global parameters. |
F10 | Toggle the margin display panel. |
<ctrl>F10 | Change display parameters for this window. |
F11 | Search forward (to the left and then down) in the current window for the next occurance of the search string. |
F12 | Search backward (to the right and then up) in the current window for a previous occurance of the search string. |
<shft>F12 | Save the current state of Dmuse in a personal default file, but don't exit Dmuse at this time. |
<ctrl>F12 | Save the current state of Dmuse in a project file you specify, but don't exit Dmuse at this time. |
<shft>PrintScreen | Format the contents of the current window for printing on an HP Printer, or any printer that speaks PCL-3 or one of its derivative languages. |
<ctrl>Break | Send the Break mesage to a Zbex program. |
Insert | (1) If a line highlight is present, Insert adds the highlighted lines to the line buffer (trash heap). The line buffer grows larger by this number of lines. (2) Otherwise, Insert toggles the editor between insert mode and overstrike mode. |
<alt>Insert | Insert blank line. Insert an empty line above the line the cursor is currently on. |
<shft>Insert | Copy the box (or stream) buffer to the screen. Insert the contents of the box buffer (if Wordwrap = off) or the contents of the stream buffer (if Wordwrap = on) at the point of the cursor. The contents of these buffers is not changed. |
<ctrl7gt;Insert | Copy the box (or stream) highlight to its buffer. If the box highlight or the stream highlight is present (set by the <shft> arrow keys), copy the contents to the appropriate buffer. |
<sfht><alt>Insert | Transfer lines from the line buffer to the screen. Remove the line or lines most recently placed in the line buffer and insert them in the current window above the line the cursor is on. |
<ctrl><shft>Insert | COPY lines from the line buffer to the screen. Insert the line or lines most recently place in the line buffer into the current window just above the line the cursor is on. The line buffer is unchanged. |
Key sequence goes here | description goes here |
Last sequence | last description |