mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	renamed keyDown -> keyPressed
This commit is contained in:
		| @@ -739,7 +739,7 @@ void CAdvMapInt::keyReleased(const SDL_Keycode &key) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void CAdvMapInt::keyDown(const SDL_Keycode & key) | ||||
| void CAdvMapInt::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	if (mode == EAdvMapMode::WORLD_VIEW) | ||||
| 		return; | ||||
|   | ||||
| @@ -160,7 +160,7 @@ public: | ||||
| 	void centerOn(const CGObjectInstance *obj, bool fade = false); | ||||
| 	int3 verifyPos(int3 ver); | ||||
| 	void handleRightClick(std::string text, tribool down); | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
| 	void keyReleased(const SDL_Keycode & key) override; | ||||
| 	void mouseMoved (const Point & cursorPosition) override; | ||||
| 	bool isActive(); | ||||
|   | ||||
| @@ -91,7 +91,7 @@ void CInGameConsole::print(const std::string &txt) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void CInGameConsole::keyDown (const SDL_Keycode & key) | ||||
| void CInGameConsole::keyPressed (const SDL_Keycode & key) | ||||
| { | ||||
| 	if(!captureAllKeys && key != SDLK_TAB) return; //because user is not entering any text | ||||
|  | ||||
|   | ||||
| @@ -26,7 +26,7 @@ public: | ||||
| 	std::string enteredText; | ||||
| 	void show(SDL_Surface * to) override; | ||||
| 	void print(const std::string &txt); | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
|  | ||||
| 	void textInputed(const SDL_TextInputEvent & event) override; | ||||
| 	void textEdited(const SDL_TextEditingEvent & event) override; | ||||
|   | ||||
| @@ -164,7 +164,7 @@ void BattleWindow::deactivate() | ||||
| 	LOCPLINT->cingconsole->deactivate(); | ||||
| } | ||||
|  | ||||
| void BattleWindow::keyDown(const SDL_Keycode & key) | ||||
| void BattleWindow::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	if(key == SDLK_q) | ||||
| 	{ | ||||
|   | ||||
| @@ -79,7 +79,7 @@ public: | ||||
|  | ||||
| 	void activate() override; | ||||
| 	void deactivate() override; | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
| 	void clickRight(tribool down, bool previousState) override; | ||||
| 	void show(SDL_Surface *to) override; | ||||
| 	void showAll(SDL_Surface *to) override; | ||||
|   | ||||
| @@ -415,7 +415,7 @@ void CGuiHandler::handleCurrentEvent( SDL_Event & current ) | ||||
| 			if(vstd::contains(keyinterested,*i) && (!keysCaptured || (*i)->captureThisKey(key.keysym.sym))) | ||||
| 			{ | ||||
| 				if (key.state == SDL_PRESSED) | ||||
| 					(**i).keyDown(key.keysym.sym); | ||||
| 					(**i).keyPressed(key.keysym.sym); | ||||
| 				if (key.state == SDL_RELEASED) | ||||
| 					(**i).keyReleased(key.keysym.sym); | ||||
| 			} | ||||
|   | ||||
| @@ -342,7 +342,7 @@ CKeyShortcut::CKeyShortcut(std::set<int> Keys) | ||||
| 	:assignedKeys(Keys) | ||||
| {} | ||||
|  | ||||
| void CKeyShortcut::keyDown(const SDL_Keycode & key) | ||||
| void CKeyShortcut::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	if(vstd::contains(assignedKeys,key) | ||||
| 	 || vstd::contains(assignedKeys, CGuiHandler::numToDigit(key))) | ||||
|   | ||||
| @@ -119,7 +119,7 @@ public: | ||||
|  | ||||
| 	//keyboard handling | ||||
| 	bool captureAllKeys; //if true, only this object should get info about pressed keys | ||||
| 	virtual void keyDown(const SDL_Keycode & key){} | ||||
| 	virtual void keyPressed(const SDL_Keycode & key){} | ||||
| 	virtual void keyReleased(const SDL_Keycode & key){} | ||||
| 	virtual bool captureThisKey(const SDL_Keycode & key); //allows refining captureAllKeys against specific events (eg. don't capture ENTER) | ||||
|  | ||||
| @@ -203,7 +203,7 @@ public: | ||||
| 	CKeyShortcut(); | ||||
| 	CKeyShortcut(int key); | ||||
| 	CKeyShortcut(std::set<int> Keys); | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
| 	void keyReleased(const SDL_Keycode & key) override; | ||||
|  | ||||
| }; | ||||
|   | ||||
| @@ -318,7 +318,7 @@ CChatBox::CChatBox(const Rect & rect) | ||||
| 	chatHistory->label->color = Colors::GREEN; | ||||
| } | ||||
|  | ||||
| void CChatBox::keyDown(const SDL_Keycode & key) | ||||
| void CChatBox::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	if(key == SDLK_RETURN && inputBox->getText().size()) | ||||
| 	{ | ||||
| @@ -326,7 +326,7 @@ void CChatBox::keyDown(const SDL_Keycode & key) | ||||
| 		inputBox->setText(""); | ||||
| 	} | ||||
| 	else | ||||
| 		inputBox->keyDown(key); | ||||
| 		inputBox->keyPressed(key); | ||||
| } | ||||
|  | ||||
| void CChatBox::addNewMessage(const std::string & text) | ||||
|   | ||||
| @@ -120,7 +120,7 @@ public: | ||||
|  | ||||
| 	CChatBox(const Rect & rect); | ||||
|  | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
| 	void addNewMessage(const std::string & text); | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -278,7 +278,7 @@ void SelectionTab::clickLeft(tribool down, bool previousState) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void SelectionTab::keyDown(const SDL_Keycode & key) | ||||
| void SelectionTab::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	int moveBy = 0; | ||||
| 	switch(key) | ||||
|   | ||||
| @@ -66,7 +66,7 @@ public: | ||||
| 	void toggleMode(); | ||||
|  | ||||
| 	void clickLeft(tribool down, bool previousState) override; | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
|  | ||||
| 	void onDoubleClick() override; | ||||
|  | ||||
|   | ||||
| @@ -778,7 +778,7 @@ void CSlider::wheelScrolled(bool down, bool in) | ||||
| 	moveTo(value + 3 * (down ? +scrollStep : -scrollStep)); | ||||
| } | ||||
|  | ||||
| void CSlider::keyDown(const SDL_Keycode & key) | ||||
| void CSlider::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	int moveDest = value; | ||||
| 	switch(key) | ||||
|   | ||||
| @@ -270,7 +270,7 @@ public: | ||||
|  | ||||
| 	void addCallback(std::function<void(int)> callback); | ||||
|  | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
| 	void wheelScrolled(bool down, bool in) override; | ||||
| 	void clickLeft(tribool down, bool previousState) override; | ||||
| 	void mouseMoved (const Point & cursorPosition) override; | ||||
|   | ||||
| @@ -549,7 +549,7 @@ void CTextInput::clickLeft(tribool down, bool previousState) | ||||
| 		giveFocus(); | ||||
| } | ||||
|  | ||||
| void CTextInput::keyDown(const SDL_Keycode & key) | ||||
| void CTextInput::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	if(!focus) | ||||
| 		return; | ||||
|   | ||||
| @@ -225,7 +225,7 @@ public: | ||||
| 	CTextInput(const Rect & Pos, std::shared_ptr<IImage> srf); | ||||
|  | ||||
| 	void clickLeft(tribool down, bool previousState) override; | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
|  | ||||
| 	bool captureThisKey(const SDL_Keycode & key) override; | ||||
|  | ||||
|   | ||||
| @@ -1255,7 +1255,7 @@ void CCastleInterface::recreateIcons() | ||||
| 		creainfo.push_back(std::make_shared<CCreaInfo>(Point(14+55*(int)i, 507), town, (int)i+4)); | ||||
| } | ||||
|  | ||||
| void CCastleInterface::keyDown(const SDL_Keycode & key) | ||||
| void CCastleInterface::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	switch(key) | ||||
| 	{ | ||||
|   | ||||
| @@ -245,7 +245,7 @@ public: | ||||
|  | ||||
| 	void castleTeleport(int where); | ||||
| 	void townChange(); | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
|  | ||||
| 	void close(); | ||||
| 	void addBuilding(BuildingID bid); | ||||
|   | ||||
| @@ -420,7 +420,7 @@ void CSpellWindow::turnPageRight() | ||||
| 		CCS->videoh->openAndPlayVideo("PGTRNRGH.SMK", pos.x+13, pos.y+15); | ||||
| } | ||||
|  | ||||
| void CSpellWindow::keyDown(const SDL_Keycode & key) | ||||
| void CSpellWindow::keyPressed(const SDL_Keycode & key) | ||||
| { | ||||
| 	if(key == SDLK_ESCAPE ||  key == SDLK_RETURN) | ||||
| 	{ | ||||
|   | ||||
| @@ -112,7 +112,7 @@ public: | ||||
| 	void selectSchool(int school); //schools: 0 - air magic, 1 - fire magic, 2 - water magic, 3 - earth magic, 4 - all schools | ||||
| 	int pagesWithinCurrentTab(); | ||||
|  | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
|  | ||||
| 	void show(SDL_Surface * to) override; | ||||
| }; | ||||
|   | ||||
| @@ -2170,7 +2170,7 @@ void CObjectListWindow::changeSelection(size_t which) | ||||
| 	selected = which; | ||||
| } | ||||
|  | ||||
| void CObjectListWindow::keyDown (const SDL_Keycode & key) | ||||
| void CObjectListWindow::keyPressed (const SDL_Keycode & key) | ||||
| { | ||||
| 	int sel = static_cast<int>(selected); | ||||
|  | ||||
|   | ||||
| @@ -195,7 +195,7 @@ public: | ||||
| 	std::shared_ptr<CIntObject> genItem(size_t index); | ||||
| 	void elementSelected();//call callback and close this window | ||||
| 	void changeSelection(size_t which); | ||||
| 	void keyDown(const SDL_Keycode & key) override; | ||||
| 	void keyPressed(const SDL_Keycode & key) override; | ||||
| }; | ||||
|  | ||||
| class CSystemOptionsWindow : public CWindowObject | ||||
|   | ||||
		Reference in New Issue
	
	Block a user