GetBreakKey
GetBreakKey Flag
 
Parameters:

    Flag = 1 will enable the ESC as the program break, 0 to disable it
Returns: NONE
 

      The GetBreakKey function reads the current state of BreakKey (Break of ESC) feature.



FACTS:


      * See BreakKey




Mini Tutorial:


      This example lets the user toggle the BreakKey control on/off while the program is running. You should notice that when BreakKey is off, hitting the ESC key has no effect upon the running program. While hitting ESC while Break is ON, will quit the program as normal.


  
; ==================
; BreakKey Example
; ==================
  
;Tell PB to limit the speed of this program
  SetFPS 60
  
  Do
   ;Clear the screen
     Cls RGB(0,0,0)
     
   ;Check if the Break Key is ON/OFF
     If GetBreakKey()=on
        s$="ON  - pressing ESC key will quit this program"
     Else
        s$="OFF - Pressing ESC has no effect"
     EndIf
     
   ; Locate the center of the screen
     cx=GetScreenWidth()/2
     cy=(GetScreenHeight()/2)-20
     
   ; Display the current status of the break key
     CenterText cx,cy,"Break Key Current Status:"+s$
   ; display the instructions
     CenterText cx,cy+30,"Press Enter To Change BreakKey Status"
     
   ; Check if the Enter Key was pressed ?
     If EnterKey()=true
        BreakKey 1-GetBreakKey()
        FlushKeys
     EndIf
     
   ; Refresh the display so the user can see it
     Sync
  Loop
  




 
Related Info: ALtKeys | BreakKey | CtrlKeys | Downkey | EnterKey | Esckey | GetScreenClose :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com