Files
oboe/osx/tools/winutil.h
Celtic Minstrel 728c294d0e Expand on text field keyboard shortcuts
- Clipboard support
- Text will now wrap when a word is longer than the width of the destination rect (doesn't just apply to text fields, but is most relevant there)
- Edit menu stub added in scenario editor code
- Rich text keys (eg cut, copy, paste, select all) are no longer processed by the dialog itself; only the text field processes them; this just means that if they were set as button equivalents they would no longer work (you'd have to set the raw equivalent instead, eg ctrl+C instead of copy).
- Text fields now rely on SFML's TextEntered event for actual input - the practical result of this is that your keyboard layout is honoured (though non-ASCII characters just display as boxes).
- In a similar vein, shift is not auto-applied to the input keys, so you'd have to set shift+2 instead of @ as the key equivalent (this actually fixes some stuff, such as in the spellcasting dialog, since I was already setting shift+2 instead of @).
2014-12-19 03:44:18 -05:00

53 lines
1.1 KiB
C++

//
// winutil.h
// BoE
//
// Created by Celtic Minstrel on 14-03-28.
//
//
#ifndef BoE_boe_windows_h
#define BoE_boe_windows_h
#include <boost/filesystem/path.hpp>
#include <SFML/Window.hpp>
namespace fs = boost::filesystem; // TODO: Centralize this alias
char keyToChar(sf::Keyboard::Key key, bool isShift);
void makeFrontWindow(sf::Window& win);
void setWindowFloating(sf::Window& win, bool floating);
void init_fileio();
fs::path nav_get_party();
fs::path nav_put_party(fs::path def = "");
fs::path nav_get_scenario();
fs::path nav_put_scenario(fs::path def = "");
// Deal with text snippets in the clipboard.
// If the clipboard contains something other than text,
// get_clipboard should return an empty string.
void set_clipboard(std::string text);
std::string get_clipboard();
void beep();
class ModalSession {
void* session;
public:
void pumpEvents();
ModalSession(sf::Window& win);
~ModalSession();
};
// System key
#ifdef __APPLE__
bool sf::Event::KeyEvent::*const systemKey = &sf::Event::KeyEvent::system;
#else
bool sf::Event::KeyEvent::*const systemKey = &sf::Event::KeyEvent::control;
#endif
#endif