Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Added
#include <iostream>
using namespace std;

enum CapsStates CapsState {
    CAPS_OFF,
    CAPS_ON
    };
enum Events Event {
    CAPS_LOCK_PRESSED,
    KEY_A_PRESSED
};
        
void kasitteleTapahtuma(Events Event tapahtuma, CapsStates CapsState &kapsLokinTila);

int main() {
    
    CapsStates  CapsState kapsLokinTila = CAPS_OFF;

...

}

void kasitteleTapahtuma(Events Event tapahtuma, CapsStates CapsState &kapsLokinTila){
    switch(tapahtuma){
        case CAPS_LOCK_PRESSED:
            if(kapsLokinTila==CAPS_OFF){
                kapsLokinTila=CAPS_ON;
                cout << "CAPS LOCK kytketty päälle\n";

...