Programming with Reflection

image\rwnprg32.gif SetTermKeyBuffer method


Syntax object.SetTermKeyBuffer Size, Overflow



Sets the buffer size of the terminal key buffer used by the GetBufferedTermKey method. The buffer size determines how many keys are remembered. By default, the buffer size is zero.

For example, this command sets the buffer size to 10 and specifies that if the number of terminal keys exceeds 10, new keys will replace the oldest keys in the buffer:

Session.SetTermKeyBuffer 10, rcOverflowShift


Size Argument type: Long
Specifies the size of the terminal key buffer. If this value is 0 (zero), the terminal key buffer is cleared and no terminal keys are remembered. If Size is greater than zero, the terminal key buffer will store the specified number of terminal keys. Use the Overflow argument to specify what happens when the number of terminal keys exceeds the size of the buffer. The TermKeyBufferSize property returns the size of the terminal key buffer.

Overflow Argument Type: Enumeration
Determines what happens when the number of terminal keys exceeds the number specified by Size. (The TermKeyBufferOverflow property returns the number of terminal keys that have been either shifted or ignored.)


 New keys are placed at the bottom of the buffer. When a new key is added to the buffer, the oldest key is dropped from the top.


 New keys are ignored; they are not added to the buffer.


Note: After you have created a terminal key buffer, you can increase its size by calling SetTermKeyBuffer again and specifying a larger buffer size. When you do this, the buffer size increases and the keystrokes currently stored in the buffer are kept. To decrease the size of the buffer, you must first reset the buffer size to zero, clearing the buffer, and then set the buffer to the size you want. If you call SetTermKeyBuffer with a smaller buffer size without resetting the buffer to zero, the call is ignored and the buffer remains at its original size.


image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command