I’m a pianist, and pianists are often very particular about how musical keyboards feel. There doesn’t appear to be a very large DIY community around it. Getting a digital keyboard to feel good has a lot of elements. It seems that it’s very expensive to design and manufacture a music keyboard, let alone to do it modularly as the keyboard community has. I would expect it to require a lot of compromises that I wouldn’t be willing to deal with except as a hobby project.
Synths, on the other hand, have a HUGE DIY community and that sometimes extends to making keyboards. But for me, it rarely seems worth it to fabricate a keyboard when a MIDI controller with MIDI cables or MIDI over USB can be had as cheaply as $50 or to have a really well done one for under $150.
I’d be more interested in modding an existing keyboard than I would creating my own from scratch.
I found this list of links related to diy instrument and synth making in case you’re interested. https://sdiy.info/wiki/Online_resources
This is such a niche topic that you should probably seek out a traditional forum. Also, check out Look Mum No Computer for some inspiration.
The most common way to sense velocity is to have two switches at different levels and calculate the delta to see how fast it moves between them. This does require precision, though.