Skip to content

Commit

Permalink
key left / key right movement
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorunome committed Oct 21, 2019
1 parent ff44fbe commit 8672c90
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions source/main.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
/*
Hello World example made by Aurelio Mannara for ctrulib
This code was modified for the last time on: 12/12/2014 21:00 UTC+1
*/

#include <3ds.h>
#include <stdio.h>
#include <malloc.h>
#include <matrixclient.h>
#include <curl/curl.h>
#include <jansson.h>

#include <string>
Expand Down Expand Up @@ -176,8 +169,12 @@ int roomPickerTop = 0;
int roomPickerItem = 0;
void roomPicker() {
u32 kDown = hidKeysDown();
if (kDown & KEY_DOWN) {
roomPickerItem++;
if (kDown & KEY_DOWN || kDown & KEY_RIGHT) {
if (kDown & KEY_DOWN) {
roomPickerItem++;
} else {
roomPickerItem += 30;
}
if (roomPickerItem >= joinedRooms.size()) {
roomPickerItem = joinedRooms.size() - 1;
}
Expand All @@ -186,8 +183,12 @@ void roomPicker() {
}
renderRooms = true;
}
if (kDown & KEY_UP) {
roomPickerItem--;
if (kDown & KEY_UP || kDown & KEY_LEFT) {
if (kDown & KEY_UP) {
roomPickerItem--;
} else {
roomPickerItem -= 30;
}
if (roomPickerItem < 0) {
roomPickerItem = 0;
}
Expand Down Expand Up @@ -263,8 +264,7 @@ void displayRoom() {
printf_bottom("\nPress A to send a message\nPress B to go back\n");
}

int main(int argc, char **argv)
{
int main(int argc, char** argv) {
gfxInitDefault();

topScreenConsole = new PrintConsole;
Expand Down

0 comments on commit 8672c90

Please sign in to comment.