Footnotes
~~~~~~~~
This is a fork of ColeslawProductions'script which in turn is a reimagining of TheV360'soriginal 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.
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.
calibration must be performed before anything elseC-Mouse1 - calibrate touchscreen top left
C-Mouse2 - calibrate touchscreen bottom right
M-x - toggle Controller ModeCapsLock - switch keyboard case
M-Left - previous slot
M-Right - next slot
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 ModeC-S-H - enable Search Mode with replace on
M-. - jump to definition (Search Mode)
C-<SPACE> - enable Select ModeS-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
10 Comment(s)AveryFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteThird YearMy account is over 3 years oldWebsiteDisguisedHiddenWebsiteI suggest doing away with my function key mappings and switching to the new SB4 keyboard mappings and shortcutsMZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesWait wait. I recently learned what Citra is. Do we have a PC emulated version of SB??chickenyes, but it's not very convenient.YolkaiHead Adminjust dump your copy or whateverMZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!HobbiesWhy isn't it convenient? You can't save files or something?snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsOne thing that sucks about citra is that it doesn't emulate new 3DS. And certain things lag extremely for no reason. YolkaiHead AdminI 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.Aris_ABeginner ProgrammerI'm just starting out! I'm still trying to grasp the basics.Programming StrengthNight PersonI like the quiet night and sleep late.Express YourselfMinecraft Is Awesome!I love Minecraft!Express Yourselfshould try sb on citraTheV360Pokemon Is Awesome!I love Pokemon!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteNight PersonI like the quiet night and sleep late.Express YourselfReally 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?YolkaiHead AdminHi, 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
turn it into a keyloggerkeep 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