Win+D boss emergency foot button

This simple project is for "Making Tech at Home" Contest.

Similar projects worth following
Well like many of us I read the article about the contest "Making Tech at Home" and I tought "why not", I will be very limited as my principal parts bin and almost all my parts (resistors, capacitors, motors, etc) are at my mom's house and with this COVID-19 my goverment on my country invite us all to stay at home, so is impossible for me access to that parts...

Using my little parts bin I assembled a simple device that emule a HID keyboard and the Win+D key combination to minimize all windows with a switch pressed with the foot, I will use on my work PC when my boss enters the office and I want to ocult some procrastination.

This project use only four parts:

  • Membrane Switch, a sample from spectra symbol they sent me 13 years ago.
  • 5600 Omhs resistor salvaged from some device.
  • AccessB from another project (7 years of slow development).
  • Some pins and cable salvaged from some device.

My goal is emule a HID keyboard that send Windows + D key combination to minimize all windows and then istall it under my work desk so I can ocult procrastination when my boss suddenly arrive at my office.

Originally I thougth to use a 18F2550 PDIP that I have but I realise that I don't have the external crystal to make it work properly, so I reuse my AccessB hardware as a proof of concept, if this work then when the COVID-19 end I will make the definitive board that will be installed uder my work desk.

AccessB is 18F2550 based, so I use MPLAB X v5.30 under ubuntu 18.04.4 LTS with XC8 v1.32 compiler and MLA libraries v2017_03_06, the firmware is a modified version of the MLA project picdem_fs_usb.x to work with the 18F2550 and the externl crystal used with the AccessB, there are some other minors modifications only to send the Win+D combination every time the "key" is pressed.

This project is a modded version of the project of the same name included on the MLA v2017_03_6, you must replace the project with this file and use XC8 v1.32 compiler in order to compile this without problems. If the external oscillator is the same as the used on the AccessB the you can compile and program the chip with any changes, on the other case you must change the oscillator configuration bits (#pragma directives) on the "system.c" file in order to match your configuration.

Zip Archive - 813.48 kB - 05/03/2020 at 08:05


  • 1 × Membrane switch, sample from specra symbol 13 years waiting to be used.
  • 1 × AccessB board Board from a older project.
  • 1 × 5.6 kOhms Resistor salvaged
  • 1 × Wire Resistors (Fixed) / Zero Ohm Jumpers
  • 1 × Pin headers salvaged

  • Video

    Omar05/04/2020 at 06:29 0 comments

    Here is the link of youtube video of the device working:

  • Soon...

    Omar05/03/2020 at 10:00 0 comments

    Later I will upload a video of the device working, see you guys.

  • Easy

    Omar05/03/2020 at 09:57 0 comments

    So this project was relatively easy, it took only two days (between my family and this) but that was thanks to AccesB board that the "base hardware", the proof of concept work, so when the COVID-19 end I will go to my mom's house for the parts that I need to make a board dedicated only to this purpose and install it under my work desk as I said before.

    So anyone can use file project shared here and making a board based on AccessB

  • Modded Files

    Omar05/03/2020 at 09:48 0 comments

    This is the list of modified files from the original proyect:

    • System.c
    • leds.c
    • app_device_keyboard.c

    Changes to System.c

    changed the #pragma directives to match the external crystal used on the AccessB (4 MHz crystal).

    Changes to leds.c

    Commented out all refereces to PortD bits, as the project was intended to be used with 18F4550 that have more GPIO than 18F2550 that don't have PortD GPIO, these pins are used to status LED that is not used.

    Changues to app_device_keyboard.c

    Here is where the keyboard functions are, originally the example work sending the scan code of the "a" letter when the input switch is pressed (at PorB4 GPIO) and the scan code value is incremented so the next char sent when the input switch is pressed again is a "b" and so on to all letters and numbers from 0 - 9 to return to "a" and repeat the cycle, that cycle was commented out and put windows key plus d key code and a delay of 10 000 instruction cycles as a simple sonftware debouncer.

    app_device_keyboard.c file lines 365 - 389

     Delay100TCYx(100); //Retardo de 10000 ciclos de instruccion, para eliminar rebotes 
            if(BUTTON_IsPressed(BUTTON_USB_DEVICE_HID_KEYBOARD_KEY) == true)
                if(keyboard.waitingForRelease == false)
                    keyboard.waitingForRelease = true;
                    /*Imitando Win+D*/
                    inputReport.keys[0] = 7; //Scan code de tecla D
                    inputReport.modifiers.bits.leftGUI = 1; //Tecla Windows
    //                /* Set the only important data, the key press data. */
    //                inputReport.keys[0] = keyboard.key++;
    //                //In this simulated keyboard, if the last key pressed exceeds the a-z + 0-9,
    //                //then wrap back around so we send 'a' again.
    //                if(keyboard.key == 40)
    //                {
    //                    keyboard.key = 4;
    //                }

  • Simple

    Omar05/03/2020 at 09:23 0 comments

    The connection between components is really simple and I will post a handmade sketch:

    +5V and GND where on 2 and 4 pin's and the input is on GPIO16 that correspond to pin 20 of the board, GPIO16 is connected to PortB4 of tof 10 000 instruction cycles.

    he 18F2550, that is becuse the MLA project for HID keyboard used that pin as input. There is no hardware deboucer but a software delay based debouncer.

    +5V and GND where on 2 and 4 from pin header and the input is on GPIO16 that correspond to pin 20 of the board pin header, GPIO16 is connected to PortB4 from 18F2550 used by MLA hid keyboard firmware.

View all 5 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates