Skip to content

Commit

Permalink
Integration of Keyboard API syscalls on Rishka VM.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed May 17, 2024
1 parent d7bc974 commit 47c858e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/rishka_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,51 @@ uint64_t RishkaVM::handleSyscall(uint64_t code) {
case RISHKA_SC_RT_FORK_STREAM:
return RishkaSyscall::Runtime::getForkString(this);

case RISHKA_SC_KB_LAYOUT_NAME:
return RishkaSyscall::Keyboard::layout_name();

case RISHKA_SC_KB_LAYOUT_DESC:
return RishkaSyscall::Keyboard::layout_desc();

case RISHKA_SC_KB_DEVICE_TYPE:
return RishkaSyscall::Keyboard::device_type();

case RISHKA_SC_KB_LED_GET_NUM:
return RishkaSyscall::Keyboard::is_num_lock();

case RISHKA_SC_KB_LED_GET_CAPS:
return RishkaSyscall::Keyboard::is_caps_lock();

case RISHKA_SC_KB_LED_GET_SCROLL:
return RishkaSyscall::Keyboard::is_scroll_lock();

case RISHKA_SC_KB_LED_SET_NUM:
RishkaSyscall::Keyboard::num_lock(this);
break;

case RISHKA_SC_KB_LED_SET_CAPS:
RishkaSyscall::Keyboard::caps_lock(this);
break;

case RISHKA_SC_KB_LED_SET_SCROLL:
RishkaSyscall::Keyboard::scroll_lock(this);
break;

case RISHKA_SC_KB_NEXT_SCAN_CODE:
return RishkaSyscall::Keyboard::next_scan_code(this);

case RISHKA_SC_KB_LOCK:
RishkaSyscall::Keyboard::lock(this);
break;

case RISHKA_SC_KB_UNLOCK:
RishkaSyscall::Keyboard::unlock();
break;

case RISHKA_SC_KB_RESET:
RishkaSyscall::Keyboard::reset();
break;

default:
this->panic("Invalid system call.");
break;
Expand Down

0 comments on commit 47c858e

Please sign in to comment.