Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
DirectInputKeyboard Class Reference

#include <Win32DIKeyboard.h>

Inherits Keyboard.

Public Member Functions

 DirectInputKeyboard (void)
 
virtual ~DirectInputKeyboard (void)
 
virtual void init (void)
 initialize the keyboard, extending init functionality
 
virtual void reset (void)
 Reset the keybaord system.
 
virtual void update (void)
 update call, extending update functionality
 
virtual Bool getCapsState (void)
 get state of caps lock key, return TRUE if down
 
- Public Member Functions inherited from Keyboard
 Keyboard (void)
 
virtual ~Keyboard (void)
 
virtual void createStreamMessages (void)
 
Bool isShift ()
 
Bool isCtrl ()
 
Bool isAlt ()
 
Int getModifierFlags ()
 
void resetKeys (void)
 reset the state of the keys
 
KeyboardIOgetFirstKey (void)
 get first key ready for processing
 
void setKeyStatusData (UnsignedByte key, KeyboardIO::StatusType data)
 set key status
 
WideChar translateKey (WideChar keyCode)
 translte key code to printable UNICODE char
 
WideChar getPrintableKey (UnsignedByte key, Int state)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Protected Member Functions

virtual void getKey (KeyboardIO *key)
 get a single key event
 
void openKeyboard (void)
 create direct input keyboard
 
void closeKeyboard (void)
 release direct input keyboard
 
- Protected Member Functions inherited from Keyboard
void initKeyNames (void)
 initialize the key names table
 
void updateKeys (void)
 update the state of our key data
 
Bool checkKeyRepeat (void)
 check for repeating keys
 
UnsignedByte getKeyStatusData (UnsignedByte key)
 get key status
 
Bool getKeyStateBit (UnsignedByte key, Int bit)
 get key state bit
 
UnsignedInt getKeySequenceData (UnsignedByte key)
 get key sequence
 
void setKeyStateData (UnsignedByte key, UnsignedByte data)
 get key state
 

Protected Attributes

LPDIRECTINPUT8 m_pDirectInput
 pointer to direct input interface
 
LPDIRECTINPUTDEVICE8 m_pKeyboardDevice
 pointer to keyboard device
 
- Protected Attributes inherited from Keyboard
UnsignedShort m_modifiers
 
UnsignedByte m_shift2Key
 
KeyboardIO m_keys [NUM_KEYS]
 the keys
 
KeyboardIO m_keyStatus [NUM_KEYS]
 the key status flags
 
struct { 
 
   WideChar   stdKey 
 
   WideChar   shifted 
 
   WideChar   shifted2 
 
m_keyNames [KEY_NAMES_COUNT
 
UnsignedInt m_inputFrame
 frame input was gathered on
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Additional Inherited Members

- Public Types inherited from Keyboard
enum  { MAX_KEY_STATES = 3 }
 
- Protected Types inherited from Keyboard
enum  { NUM_KEYS = 256 }
 
enum  { KEY_NAMES_COUNT = 256 }
 

Detailed Description

Class for interfacing with the keyboard using direct input as the implementation

Definition at line 70 of file Win32DIKeyboard.h.

Constructor & Destructor Documentation

◆ DirectInputKeyboard()

DirectInputKeyboard::DirectInputKeyboard ( void )

Definition at line 341 of file Win32DIKeyboard.cpp.

◆ ~DirectInputKeyboard()

DirectInputKeyboard::~DirectInputKeyboard ( void )
virtual

Definition at line 361 of file Win32DIKeyboard.cpp.

Member Function Documentation

◆ closeKeyboard()

void DirectInputKeyboard::closeKeyboard ( void )
protected

release direct input keyboard

close the direct input keyboard

Definition at line 217 of file Win32DIKeyboard.cpp.

◆ getCapsState()

Bool DirectInputKeyboard::getCapsState ( void )
virtual

get state of caps lock key, return TRUE if down

Return TRUE if the caps lock key is down/hilighted

Implements Keyboard.

Definition at line 420 of file Win32DIKeyboard.cpp.

◆ getKey()

void DirectInputKeyboard::getKey ( KeyboardIO * key)
protectedvirtual

get a single key event

Get a single keyboard event from direct input

Implements Keyboard.

Definition at line 245 of file Win32DIKeyboard.cpp.

◆ init()

void DirectInputKeyboard::init ( void )
virtual

initialize the keyboard, extending init functionality

initialize the keyboard

Reimplemented from Keyboard.

Definition at line 372 of file Win32DIKeyboard.cpp.

◆ openKeyboard()

void DirectInputKeyboard::openKeyboard ( void )
protected

create direct input keyboard

create our interface to the direct input keybard

Todo
Check the cooperative level of keyboard for NT, 2000, DX8 etc ...

Definition at line 115 of file Win32DIKeyboard.cpp.

◆ reset()

void DirectInputKeyboard::reset ( void )
virtual

Reset the keybaord system.

Reset keyboard system

Reimplemented from Keyboard.

Definition at line 386 of file Win32DIKeyboard.cpp.

◆ update()

void DirectInputKeyboard::update ( void )
virtual

update call, extending update functionality

called once per frame to update the keyboard state

Reimplemented from Keyboard.

Definition at line 397 of file Win32DIKeyboard.cpp.

Member Data Documentation

◆ m_pDirectInput

LPDIRECTINPUT8 DirectInputKeyboard::m_pDirectInput
protected

pointer to direct input interface

Definition at line 96 of file Win32DIKeyboard.h.

◆ m_pKeyboardDevice

LPDIRECTINPUTDEVICE8 DirectInputKeyboard::m_pKeyboardDevice
protected

pointer to keyboard device

Definition at line 97 of file Win32DIKeyboard.h.


The documentation for this class was generated from the following files: