---
title: "IrReceiver"
canonical: "https://docs.cuesystem.com/space/CVCHELP/512327731/IrReceiver"
format: markdown
---
> Macro (toc)

---

Ir receiver is used to receive Ir Sony codes (SIRC). Ir receiver supports receiving 12bit, 15bit, and 20bit SIRC.   

# IsPressed

The function returns True if the SIRC code given in the buttoncode parameter is currently being received by the Ir receiver.

#### Syntax 

```visualbasic
Function IsPressed(buttoncode As Long) As Boolean
```

#### Parameters 

buttoncode 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> SIRC code that is tested by the function. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True if a SIRC is being received, False otherwise. 

# OnPush

This event is raised when a SIRC begins to be received. The SIRC code is passed in the buttoncode parameter.

#### Syntax 

```visualbasic
Event OnPush(buttoncode As Long)
```

#### Parameters

buttoncode 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> SIRC code received by Ir receiver. 

# WaitWhilePressed

This function waits while a SIRC code given in the buttoncode parameter is received and until the timeout elapsed. 

#### Syntax 

```visualbasic
Function WaitWhilePressed(buttoncode As Long, Optional timeout As Time := _TIME_INFINITE) As Boolean
```

#### Parameters 

buttoncode 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> SIRC code that is tested by the function. 

timeout 

<u>[Time](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> Optional, defaults to _TIME_INFINITE. It is time to wait. 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is true if the timeout was not expired when the SIRC receiving was stopped. It is false if the timeout expired and the SIRC was still received.