    

 ## On this page

  

 

 # OpenTD.AddIn.UserBreak Class Reference

 Last update: 16.07.2025 

Allow end users to cancel long-running tasks by pressing ESC. Only works with [OpenTD](namespace_open_t_d.xhtml "Base Thermal Desktop functionality.") [AddIn](namespace_open_t_d_1_1_add_in.xhtml)'s created using the [IAddIn](interface_open_t_d_1_1_add_in_1_1_i_add_in.xhtml "<exclude >") interface. [More...](#details)

Inheritance diagram for OpenTD.AddIn.UserBreak:

 ![](/sites/default/files/migrate-content/opentd_refefence_net_8_2025_r2_doc_1/class_open_t_d_1_1_add_in_1_1_user_break.png)



## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [UserBreak](#aeff6588cf4c56e7f6be8c9484aeffeb8) ([ThermalDesktop](class_open_t_d_1_1_thermal_desktop.xhtml) \_td) void [Enable](#a4df01ed8a96a8980abc7e1a883824ddc) () Start listening for ESC.   
 void [Disable](#ae3aeb4584c0b122aabfb70f4c0e03d22) () Stop listening for ESC.   
 bool [BreakRequested](#a2c3777c4a71e1c7fc986a6b437e4ceaa) () Test whether ESC has been pressed.   
 void [ConfirmationOn](#aa3b455be06e2ef18377c5a1450454d27) () If confirmation is on, BreakRequested will confirm that the user meant to hit ESC before returning true.   
 void [ConfirmationOff](#a555d32a40e3a70c9a456720914bb0ab3) () If confirmation is off, BreakRequested will immediately return true if the user hit ESC.   
 <a id="details" name="details"></a>## Detailed Description

Allow end users to cancel long-running tasks by pressing ESC. Only works with [OpenTD](namespace_open_t_d.xhtml "Base Thermal Desktop functionality.") [AddIn](namespace_open_t_d_1_1_add_in.xhtml)'s created using the [IAddIn](interface_open_t_d_1_1_add_in_1_1_i_add_in.xhtml "<exclude >") interface.

&lt;exclude &gt;



## Constructor &amp; Destructor Documentation

<a id="aeff6588cf4c56e7f6be8c9484aeffeb8" name="aeff6588cf4c56e7f6be8c9484aeffeb8"></a>## [◆ ](#aeff6588cf4c56e7f6be8c9484aeffeb8)UserBreak()

 OpenTD.AddIn.UserBreak.UserBreak  ( [ThermalDesktop](class_open_t_d_1_1_thermal_desktop.xhtml) *\_td*)   inline 





## Member Function Documentation

<a id="a2c3777c4a71e1c7fc986a6b437e4ceaa" name="a2c3777c4a71e1c7fc986a6b437e4ceaa"></a>## [◆ ](#a2c3777c4a71e1c7fc986a6b437e4ceaa)BreakRequested()

 bool OpenTD.AddIn.UserBreak.BreakRequested  ( )   inline 

Test whether ESC has been pressed.

Implements [OpenTD.AddIn.IUserBreak](interface_open_t_d_1_1_add_in_1_1_i_user_break.xhtml#a0643da31a21c1b7c46f60dca074dedbd).





<a id="a555d32a40e3a70c9a456720914bb0ab3" name="a555d32a40e3a70c9a456720914bb0ab3"></a>## [◆ ](#a555d32a40e3a70c9a456720914bb0ab3)ConfirmationOff()

 void OpenTD.AddIn.UserBreak.ConfirmationOff  ( )   inline 

If confirmation is off, BreakRequested will immediately return true if the user hit ESC.

Implements [OpenTD.AddIn.IUserBreak](interface_open_t_d_1_1_add_in_1_1_i_user_break.xhtml#af446fa3380004ac5ba3f03343a74b4ac).





<a id="aa3b455be06e2ef18377c5a1450454d27" name="aa3b455be06e2ef18377c5a1450454d27"></a>## [◆ ](#aa3b455be06e2ef18377c5a1450454d27)ConfirmationOn()

 void OpenTD.AddIn.UserBreak.ConfirmationOn  ( )   inline 

If confirmation is on, BreakRequested will confirm that the user meant to hit ESC before returning true.

Implements [OpenTD.AddIn.IUserBreak](interface_open_t_d_1_1_add_in_1_1_i_user_break.xhtml#a797eab8f98b2246ff4935311161b88c9).





<a id="ae3aeb4584c0b122aabfb70f4c0e03d22" name="ae3aeb4584c0b122aabfb70f4c0e03d22"></a>## [◆ ](#ae3aeb4584c0b122aabfb70f4c0e03d22)Disable()

 void OpenTD.AddIn.UserBreak.Disable  ( )   inline 

Stop listening for ESC.

Implements [OpenTD.AddIn.IUserBreak](interface_open_t_d_1_1_add_in_1_1_i_user_break.xhtml#a4ec46108982e01c68b037869fbb9d73c).





<a id="a4df01ed8a96a8980abc7e1a883824ddc" name="a4df01ed8a96a8980abc7e1a883824ddc"></a>## [◆ ](#a4df01ed8a96a8980abc7e1a883824ddc)Enable()

 void OpenTD.AddIn.UserBreak.Enable  ( )   inline 

Start listening for ESC.

Implements [OpenTD.AddIn.IUserBreak](interface_open_t_d_1_1_add_in_1_1_i_user_break.xhtml#a774ffbf8bd66b6a2519fe8568df5d898).





---

The documentation for this class was generated from the following file:- C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/OpenTD/OpenTD/AddIn/**UserBreak.cs**