Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

functionKey

functionKey posInteger

Note: posInteger must yield a number between 1 and 15.

HyperCard sends the functionKey command to the current card when the user presses one of the function keys on the Apple Extended Keyboard.

The functionKey command performs an undo, cut, copy, or paste for the values 1 through 4. Integer values 5 through 15 have no built-in effect.

You can handle the functionKey message as follows:

on functionKey whichKey
   statements
end functionKey



Examples

functionKey 1 -- performs undo
functionKey 2 -- performs cut
functionKey 3 -- performs copy
functionKey 4 -- performs paste

  
-- An example handler:

on functionKey whichKey  
  if whichKey is 5 then myCoolHandler
  else if whichKey is 6 then choose browse tool 
  else if whichKey is 7 then choose button tool
  else if whichKey is 8 then choose field tool
  else pass functionKey
end functionKey

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

statements
Any return-separated list of built-in commands, user-defined handlers, or keywords that are part of a message or function handler.

put "Hello world"   -- built-in command
get total(field 1)  -- function call
global HelpInfo     -- keyword


Related Topics

« find | HyperTalk Reference | get »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

functionKey

functionKey posInteger

Note: posInteger must yield a number between 1 and 15.

HyperCard sends the functionKey command to the current card when the user presses one of the function keys on the Apple Extended Keyboard.

The functionKey command performs an undo, cut, copy, or paste for the values 1 through 4. Integer values 5 through 15 have no built-in effect.

You can handle the functionKey message as follows:

on functionKey whichKey
   statements
end functionKey



Examples

functionKey 1 -- performs undo
functionKey 2 -- performs cut
functionKey 3 -- performs copy
functionKey 4 -- performs paste

  
-- An example handler:

on functionKey whichKey  
  if whichKey is 5 then myCoolHandler
  else if whichKey is 6 then choose browse tool 
  else if whichKey is 7 then choose button tool
  else if whichKey is 8 then choose field tool
  else pass functionKey
end functionKey

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

statements
Any return-separated list of built-in commands, user-defined handlers, or keywords that are part of a message or function handler.

put "Hello world"   -- built-in command
get total(field 1)  -- function call
global HelpInfo     -- keyword


Related Topics

« find | HyperTalk Reference | get »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View