Design Pattern Examples
Overview of object-oriented design patterns
checkforkey.c File Reference

Implementation of the checkforkey() function for determining if a key has been pressed. More...

#include <unistd.h>
#include <sys/time.h>
#include "checkforkey.h"
Include dependency graph for checkforkey.c:

Go to the source code of this file.

Functions

int kbhit (void)
 
bool checkforkey (void)
 Determine if a key has been pressed.
 

Detailed Description

Implementation of the checkforkey() function for determining if a key has been pressed.

Definition in file checkforkey.c.

Function Documentation

◆ checkforkey()

bool checkforkey ( void  )

Determine if a key has been pressed.

Determine if a key has been pressed on the keyboard.

Returns
Returns true if a key has been pressed; otherwise, returns false. Call readkey() to get the actual key.

Definition at line 39 of file checkforkey.c.

References kbhit().

Referenced by Flyweight_Exercise().

◆ kbhit()

int kbhit ( void  )

Definition at line 16 of file checkforkey.c.

Referenced by Helpers::checkforkey(), and checkforkey().