LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Yttria's Keyboard Adapter for Citra SmileBASIC

Root / Submissions / [.]

YolkaiCreated:
Table of Contents:
  • Download
  • Commands Global keys Commands during normal keyboard mode Search mode navigation Select mode commands Controller mode Dialog mode
  • Future Plans
  • Footnotes ~~~~~~~~ This is a fork of ColeslawProductions' script which in turn is a reimagining of TheV360's original AutoHotkey script. This is an AutoHotkey script (sorry, Windows only1) that builds on its predecessors to provide a mapping from the OS keyboard layer to SmileBASIC's software keyboard in citra-emu by sending mouse events. Some features include:
    • Switching between controller mode and keyboard mode
    • Respecting user button configuration (with one recommendation)
    • Support for file save dialog
    • Typical text editor command access: copy/paste/save/find etc.
    • Text selection
    • Slot navigation
    It is highly recommended that you map the D-Pad buttons to the arrow keys prior to using the script. For an even more convenient way to edit SmileBASIC programs on a PC for use with Citra, please check out smilebasic-mode for emacs.

    Download

    The project is available at https://github.com/y-ack/citra-smilebasic-keyboard A binary for 64-bit Windows systems can be downloaded from releases The script assumes that you have a key profile defined and that qt-config.ini is in SmileBASIC's appdata directory. Please use Ctrl+LeftClick to define the top left corner of the touch screen and Ctrl+RightClick to define the bottom right corner of the touch screen on running the adapter.

    Commands

    It is highly recommended that you map the D-Pad buttons to the arrow keys prior to using the script. This guide uses Emacs key notation. slash / indicates either-or.
    | prefix |  meaning  |
    |--------+-----------|
    | C      | "Control" |
    | M      | "Alt"     |
    | S      | "Shift"   |

    Global

    calibration must be performed before anything else C-Mouse1 - calibrate touchscreen top left C-Mouse2 - calibrate touchscreen bottom right M-x - toggle Controller Mode CapsLock - switch keyboard case M-Left - previous slot M-Right - next slot

    Keyboard Mode

    normal keys - insert text backspace - backspace <RETURN> - insert newline C-s - save slot (enable Dialog Mode) C-o - open file in slot C-v - paste C-z - undo C-y - redo C-Left, home - beginning of line C-Right, end - end of line C-Up, PgUp - scroll up C-Down, PgDn - scroll down C-f - enable Search Mode C-S-H - enable Search Mode with replace on M-. - jump to definition (Search Mode) C-<SPACE> - enable Select Mode S-arrows - Select and move F1-F5 - function keys F6 - direct mode F7-F10 - slot 0-3 C-/, C-' - make current line a comment M-w - insert WHILE WEND (experimental) M-i - insert IF THEN (experimental) M-l - insert ELSEIF THEN (experimental) C-h - toggle SB help

    Search Mode

    normal keys - enter search/replace query C-, (<) - previous result C-. (>) - next result <RETURN> - commit replace C-h - toggle replace mode C-f - exit Search Mode

    Select Mode

    C-c - copy C-x - cut C-v - paste C-<SPACE> - exit Select Mode motion keys: as expected

    Controller Mode

    keys are unassigned (use Citra settings) except C-<SPACE> - toggle Select Mode

    Dialog Mode

    enabled during file saving valid filename keys enter respective character C-c - cancel <RETURN> - OK backspace - backspace

    Future Plans

    see comments on this page I guess

    Footnotes

    [1] I'm interested in helping port this to GNU+Linux systems. If you know of a possibly appropriate library, please contact me and I'll take a look. other tools: [2]https://github.com/y-ack/smilebasic-mode [3]http://trinitro21.github.io/ [4]http://smilebasicsource.com/forum?ftid=468

  • Really good, I like how easy it is to set up and how you've added so many useful shortcuts. However, I have two problems with this so far: 1. There's a lot of latency, and my inputs keep getting dropped. This could just be the .exe builds though. 2. I can't easily type exclamation mark from the lowercase keyboard. Maybe mark some keys as requiring the keyboard to be in an uppercase state? Still, I'm glad that people with actual knowledge and experience with AHK are making this, rather than me. Edit: Insane idea: AHK has a function that can read the color of a pixel. Maybe "scan" across the rows of suggestions, find where each suggestion ends, and bind the top 5 suggestions to some other keys?

    Replying to:TheV360
    Really good, I like how easy it is to set up and how you've added so many useful shortcuts. However, I have two problems with this so far: 1. There's a lot of latency, and my inputs keep getting dropped. This could just be the .exe builds though. 2. I can't easily type exclamation mark from the lowercase keyboard. Maybe mark some keys as requiring the keyboard to be in an uppercase state? Still, I'm glad that people with actual knowledge and experience with AHK are making this, rather than me. Edit: Insane idea: AHK has a function that can read the color of a pixel. Maybe "scan" across the rows of suggestions, find where each suggestion ends, and bind the top 5 suggestions to some other keys?
    Hi, thanks for the comment. Not sure about the latency issue. I know I'm not the fastest typist compared to some of my peers on SBS so maybe it just happened to work okay for my typing speed but breaks down with faster input, and when I tried to write a similar script in Powershell a long time ago, timing issues made it unusable... I'm also aware of some timing problems with holding down keys mapped to button presses that cause some weird behavior where I just gave up after manipulating the delay intervals and not seeing any results better than the current values. I would definitely try compiling the script on your own machine. I've thought about the shift-state issue and definitely want to do some things to make it more convenient, but it requires a lot of refactoring and I decided it wouldn't make it into this release. I don't know any AutoHotkey so everything here is what I was able to learn in two days, so I didn't even consider trying to read the screen. I did consider a shortcut to just insert the first text suggestion, but figured it's not really even that useful when it's now faster to type keywords out anyway (at least, on my machine). One thing that might be cool is to turn it into a keylogger keep track of input and be able to construct a word list for the session for tab-completion (better would be too look at the saved program if it exists first, too, but requires user to provide filename). Other things I'd like to add: - either find a way to automatically calculate the screen position (even if just for the default layout) OR save the configuration to a file so that it at least doesn't have to be recalibrated every run. - fix some weird thing where C-s or something is also bound to 'toggle frame advancing' or something that ruins everything - maybe get smilebasic-mode to communicate with it so that files can be loaded/executed with a few keystrokes from emacs

    should try sb on citra

    Wait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??

    Replying to:MZ952
    Wait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??
    yes, but it's not very convenient.

    Replying to:MZ952
    Wait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??
    just dump your copy or whatever

    Replying to:MZ952
    Wait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??
    Why isn't it convenient? You can't save files or something?

    Replying to:MZ952
    Wait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??
    One thing that sucks about citra is that it doesn't emulate new 3DS. And certain things lag extremely for no reason.

    Replying to:MZ952
    Wait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??
    I wouldn't call it "inconvenient" but there are things to be mindful of... You can't download/upload projects Depending on your machine you'll get maybe 50% speed during execution And it won't emulate n3DS correctly Having SB files deep in AppData isn't a problem if you make a soft link.

    I suggest doing away with my function key mappings and switching to the new SB4 keyboard mappings and shortcuts