mirror of
https://github.com/IanDarwin/OpenLookCDROM.git
synced 2026-02-13 11:34:52 +00:00
70 lines
1.8 KiB
Plaintext
70 lines
1.8 KiB
Plaintext
% Ever wonder to to use all those keys around the side of the keyboard?
|
|
% here is some real low level grit on how to program all the keys.
|
|
% Note that gterm uses the global keyboard tables, so any Fkeys you define
|
|
% will wipe out any other global fkeys.
|
|
%
|
|
% This suff works under OpenWindow 2.0 tNt 1.0
|
|
% Much of this works under NeWS 1.1...
|
|
|
|
% Function F5 spits out some text of our choice, as if we had typed it
|
|
/FunctionF5 {
|
|
dup begin
|
|
/Name /InsertValue def
|
|
/Action (!make) def
|
|
end
|
|
redistributeevent
|
|
} bindkey
|
|
|
|
% Bind F9 to a string which is run as a unix command!
|
|
% This is run on the Display server...
|
|
%This does not work so well, but its what the doc says works
|
|
%/FunctionF9 (gterm) bindkey
|
|
%try this, as it really DOES work!
|
|
/FunctionF9 {(gterm) runcommand} bindkey
|
|
|
|
% This Spits the current selection out as if you had typed it
|
|
% It has not been hacked to drag selectons out of X crud
|
|
/FunctionL6 {
|
|
dup % Dup the event that broght us the function key press
|
|
/PrimarySelection getselection {
|
|
% If null selection ignore
|
|
{ dup null eq }
|
|
{pop false}
|
|
% Newer Style OL selections
|
|
{ dup /SelectionContents known}
|
|
{
|
|
dup /SelectionContents get
|
|
type ( ) cvs
|
|
(stringtype) eq
|
|
{/SelectionContents get true}
|
|
{false}
|
|
ifelse
|
|
}
|
|
% Old style LiteUI
|
|
{ dup /ContentsAscii known}
|
|
{/ContentsAscii get true}
|
|
% Old style in new enviorment
|
|
{ dup /SelInfo known}
|
|
{
|
|
/SelInfo get dup
|
|
/ContentsAscii known
|
|
{/ContentsAscii get true}
|
|
{pop false}
|
|
ifelse
|
|
}
|
|
% Default Case
|
|
{ pop true }
|
|
{ false }
|
|
} cond
|
|
{
|
|
% stuff the text here!
|
|
% console exch (Hey: %\n) fprintf
|
|
exch % Stack: fkey'event selectoin'string
|
|
begin
|
|
/Name /InsertValue def
|
|
/Action exch def
|
|
end
|
|
redistributeevent
|
|
} if
|
|
} bindkey
|