-
-
Notifications
You must be signed in to change notification settings - Fork 38.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New clueboard keymap that is a tetris game #1574
Conversation
Haha, this is awesome :) is there a PCB/kit available for purchase? We try to keep projects in the |
This is a strictly home-built keyboard. Can you recommend a board that is commonly used, and already have compile-time dependency switches to make it easier to add another? |
Rather than adding a whole new keyboard. I have added a keymap to the clueboard keyboard. However, I do not have a clueboard keyboard, so I cannot verify if it works. |
Thank you for trying it, sorry it does not work. As you found out, tetris_text.c should be included due to the 'SRC = .." line in Makefile. It compiles on my system with a 'git clone ...; cd qmk-keyboard; make clueboard-tetris'. While tetris is running, it catches arrow key presses to move the block. However, it should also constantly be sending a bunch of fake keypresses to draw the game. You can quit the game by pressing escape, that should give you back control of your arrow keys. Since it stole your arrow keys, that means that F(1) and process_record_user(..) works. So maybe matrix_scan_user(..) does not get called. But clueboard/keymaps/magicmonty also use it. I cannot debug it further without getting a qmk-supported keyboard. It works on my hand-wired keyboard meckb_da64. |
I don't have a clueboard but copied the code over to my tada68 (atmega32u4). It's here if you want to take a look at it. Thank you for your contribution to QMK! |
I have changed this pull request to add a tetris keymap to the clueboard keyboard rather than adding a new homemade keyboard. Note: do not accept this pull request until someone tests if it actually works. If someone have any qmk-supported keyboard and some spare time, I will happily change this pull request to add a keymap to a different keyboard that can be tested. |
I just gave it a try on my board and it seems to work as advertised, but maybe only on windows? On my mac it draws the play field twice, the second time not quite correctly, and then the blocks are screwed up. I think it's relying on keystrokes that don't work on TextEdit. |
@skullydazed You're not the only one, mine does the same on Windows 10 in Notepad++. |
e5ebb8a
to
455dfb7
Compare
It seems that macs think that home/end means go to top/bottom of document without moving the cursor. So I have changed the code so it no longer sends HOME and END. The game was only sending HOME and END events when building the board and the game over screen, so there will no performance penalty. Now the game only sends: left, right, up, down, delete, backspace, qwerty, shift (for upper-case), and numbers. The game should work on macs now. I tested notepad++ on a windows machine. That broke for me because notepad++ popped up auto-completing helper dialogs that stole arrow key presses. Note: I rebased my diffs to simplify merging, so there is only 1 commit. Thanks for all the great feedback. |
I think I fixed the drawing-board-twice bug. I now only draw the board on a key down event. |
Looks like this is ready - awesome! Thanks :D |
It works by outputting key-presses to make ascii-art in a regular text editor. It reads key presses to rotate and move the bricks like a regular tetris game.
See gif for an example.
It is not fast nor responsive, but it is silly.
It also serve as an example on how to use process_record_user(..), matrix_scan_user(..), and how to send a keycodes. however, I do not know know if it is an example of correct usage or disastrous usage.