Can I modify this bluetooth keyboard to only have a certain keys so I can carry it around?
I think that will probably work for what you want to use it for.

You'll need to trace the connections from your 2 buttons of interest back to the connector on the PCB and then solder a pair of your own buttons across those connections (the PCB is the rigid green board with components soldered to it).

You can't solder to the flexible plastic part, but that doesn't matter since once you've figured out which of the silver tracks inside it correspond to the buttons you're interested in and which pins on the connector they lead to, you can unplug it from the PCB since you won't need it anymore.

You're wondering how the electronics on the PCB manages to map all of the keys using a much smaller number of pins?
The answer is that the keys are arranged in a matrix, so each of the pins is actually shared between multiple keys.
If you imagine a simpler matrix of 12 buttons like you might find on a phone, you don't need 12 connections to read them - you only need 7.







simulate this circuit &ndash; Schematic created using CircuitLab

This does sometimes create some issues, for example if SW1 and SW5 are both pressed at the same time it could be a bit more difficult to read, but there are ways around this.