Skip to content

Commit

Permalink
add function, Ctrl + 1 can swap CD
Browse files Browse the repository at this point in the history
  • Loading branch information
citee520 authored and caiiiycuk committed May 21, 2024
1 parent d810cf9 commit a7fa7f6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions native/dosbox-jsdos/jsdos/jsdos-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Created by caiiiycuk on 26.02.2020.
//

#include "../dosbox/include/bios_disk.h"

#include <config.h>
#include <control.h>
#include <jsdos-support.h>
Expand All @@ -22,6 +24,8 @@
#include <emscripten/html5.h>
#endif

void swapInNextDisk(bool pressed);

struct KBDHash {
template <typename T>
std::size_t operator()(T t) const {
Expand Down Expand Up @@ -368,7 +372,19 @@ void GFX_Events() {
}


bool press_ctrl = false;
void server_add_key(KBD_KEYS key, bool pressed, uint64_t pressedMs) {
if (key == 341 && pressed == 1){ //ctrl
press_ctrl = true;
}
if (key == 341 && pressed == 0){ //ctrl
press_ctrl = false;
}
if (key == 49 && pressed == 1 && press_ctrl == true){ // 1
//DriveManager::CycleAllDisks();
swapInNextDisk(1);
}

keyEvents.push_back({ key, pressed, pressedMs });
if (keyEvents.size() == 1 && pressed) {
executeNextKeyEventAt = GetMsPassedFromStart();
Expand Down

0 comments on commit a7fa7f6

Please sign in to comment.