mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-20 07:11:37 +02:00
Update to v094r24 release.
byuu says: Finally!! Compilation works once again on Windows. However, it's pretty buggy. Modality isn't really working right, you can still poke at other windows, but when you select ListView items, they redraw as empty boxes (need to process WM_DRAWITEM before checking modality.) The program crashes when you close it (probably a ruby driver's term() function, that's what it usually is.) The Layout::setEnabled(false) call isn't working right, so you get that annoying chiming sound and cursor movement when mapping keyboard keys to game inputs. The column sizing seems off a bit on first display for the Hotkeys tab. And probably lots more.
This commit is contained in:
@@ -13,10 +13,10 @@ struct InputKeyboardRawInput {
|
||||
vector<Key> keys;
|
||||
|
||||
struct Keyboard {
|
||||
HID::Keyboard hid;
|
||||
shared_pointer<HID::Keyboard> hid{new HID::Keyboard};
|
||||
} kb;
|
||||
|
||||
void update(RAWINPUT* input) {
|
||||
auto update(RAWINPUT* input) -> void {
|
||||
unsigned code = input->data.keyboard.MakeCode;
|
||||
unsigned flag = input->data.keyboard.Flags;
|
||||
|
||||
@@ -26,19 +26,19 @@ struct InputKeyboardRawInput {
|
||||
}
|
||||
}
|
||||
|
||||
void assign(unsigned inputID, bool value) {
|
||||
auto& group = kb.hid.group[HID::Keyboard::GroupID::Button];
|
||||
if(group.input[inputID].value == value) return;
|
||||
if(input.onChange) input.onChange(kb.hid, HID::Keyboard::GroupID::Button, inputID, group.input[inputID].value, value);
|
||||
group.input[inputID].value = value;
|
||||
auto assign(unsigned inputID, bool value) -> void {
|
||||
auto& group = kb.hid->buttons();
|
||||
if(group.input(inputID).value() == value) return;
|
||||
if(input.onChange) input.onChange(kb.hid, HID::Keyboard::GroupID::Button, inputID, group.input(inputID).value(), value);
|
||||
group.input(inputID).setValue(value);
|
||||
}
|
||||
|
||||
void poll(vector<HID::Device*>& devices) {
|
||||
auto poll(vector<shared_pointer<HID::Device>>& devices) -> void {
|
||||
for(unsigned n = 0; n < keys.size(); n++) assign(n, keys[n].value);
|
||||
devices.append(&kb.hid);
|
||||
devices.append(kb.hid);
|
||||
}
|
||||
|
||||
bool init() {
|
||||
auto init() -> bool {
|
||||
rawinput.updateKeyboard = {&InputKeyboardRawInput::update, this};
|
||||
|
||||
//Pause sends 0x001d,4 + 0x0045,0; NumLock sends only 0x0045,0
|
||||
@@ -163,8 +163,8 @@ struct InputKeyboardRawInput {
|
||||
keys.append({0x005c, 2, "RightSuper"});
|
||||
keys.append({0x005d, 2, "Menu"});
|
||||
|
||||
kb.hid.id = 1;
|
||||
for(auto& key : keys) kb.hid.button().append({key.name});
|
||||
kb.hid->setID(1);
|
||||
for(auto& key : keys) kb.hid->buttons().append(key.name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user