Basic mousewheel support

This commit is contained in:
Henrik Rydgård 2013-07-08 11:04:03 +02:00
parent 864457219d
commit 183740a5fa
3 changed files with 15 additions and 2 deletions

View File

@ -1781,6 +1781,19 @@ FileSelectScreen::FileSelectScreen(const FileSelectScreenOptions &options) : opt
updateListing(); updateListing();
} }
void FileSelectScreen::key(const KeyInput &key) {
if (key.flags & KEY_DOWN) {
switch (key.keyCode) {
case KEYCODE_EXT_MOUSEWHEEL_UP:
list_.scrollRelative(-50);
break;
case KEYCODE_EXT_MOUSEWHEEL_DOWN:
list_.scrollRelative(50);
break;
}
}
}
void FileSelectScreen::updateListing() { void FileSelectScreen::updateListing() {
listing_.clear(); listing_.clear();
getFilesInDir(currentDirectory_.c_str(), &listing_, options_.filter); getFilesInDir(currentDirectory_.c_str(), &listing_, options_.filter);
@ -1850,7 +1863,6 @@ void CreditsScreen::update(InputState &input_state) {
void CreditsScreen::render() { void CreditsScreen::render() {
I18NCategory *c = GetI18NCategory("PSPCredits"); I18NCategory *c = GetI18NCategory("PSPCredits");
const char * credits[] = { const char * credits[] = {

View File

@ -187,6 +187,7 @@ public:
// Override these to for example write the current directory to a config file. // Override these to for example write the current directory to a config file.
virtual void onSelectFile() {} virtual void onSelectFile() {}
virtual void onCancel() {} virtual void onCancel() {}
void key(const KeyInput &key);
private: private:
void updateListing(); void updateListing();

2
native

@ -1 +1 @@
Subproject commit 7a8076f3b216a2577f1fa52f67622f7ace4b525b Subproject commit 57d3fa01345d447cad3d943838a74c71e4e08a7e