<commit_before>#include "Keyboard.h"

extern Status *status;
extern Model *model;

void Keyboard::loginKeyboard(unsigned char key, int x, int y) {
	cout << "KEY: " << key << endl;
	if (status->nextInput) { // in passwod
		if (key == 13) { // if enter pressed 
			cout << "SUBMIT DATA";
		}
		else {
			status->password.push_back(key);
			status->passwd.push_back('*');
			cout << "Password: " << status->password << endl;
		}
	}
	else {
		if (key == 13) { // in username 
			status->nextInput = true; // go to password
		}
		else {
			status->username.push_back(key);
			cout << "Username: " << status->username << endl;
		}
	}

	glutPostRedisplay();

}
void Keyboard::keyboard(unsigned char key, int x, int y){
    
	// in case wordls menu is visible
	if (status->showMapMenu) {
		switch (key) {
		case'1':
			status->mapfile = "mundo1.grafo";
			leGrafo(status->mapfile);
			break;
		case '2':
			status->mapfile = "quarto1.grafo";
			leGrafo(status->mapfile);
			break;<commit_msg>Add some input verifications ref #38<commit_after>#include "Keyboard.h"

extern Status *status;
extern Model *model;

void Keyboard::loginKeyboard(unsigned char key, int x, int y) {
	cout << "KEY: " << key << endl;
	if (status->nextInput) { // in passwod
		if (key == 13) { // if enter pressed 
			cout << "SUBMIT DATA";
		}
		else if (key == 8) {
			status->password.pop_back();
			status->passwd.pop_back();
		} else {
			if (key > 33 && key < 126) {
				status->password.push_back(key);
				status->passwd.push_back('*');
				cout << "Password: " << status->password << endl;
			}
		}
	}
	else {
		if (key == 13) { // in username 
			status->nextInput = true; // go to password
		}
		else if (key == 8) {
			status->username.pop_back();
		} else {
			if (key > 33 && key < 126) {
				status->username.push_back(key);
				cout << "Username: " << status->username << endl;
			}
		}
	}

	glutPostRedisplay();

}
void Keyboard::keyboard(unsigned char key, int x, int y){
    
	// in case wordls menu is visible
	if (status->showMapMenu) {
		switch (key) {
		case'1':
			status->mapfile = "mundo1.grafo";
			leGrafo(status->mapfile);
			break;
		case '2':
			status->mapfile = "quarto1.grafo";
			leGrafo(status->mapfile);
			break;
{'fraction_non_alphanumeric': 0.17208672086720866, 'fraction_numerical': 0.013550135501355014, 'mean_word_length': 3.0642201834862384, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2972612', 'n_tokens_mistral': 929, 'n_tokens_neox': 803, 'n_words': 199}