Question: I would like to be able to play a piano or keyboard and have what I play stored and reproduced as musical notation. Is that possible?

Answer: 
This is very feasible, and has been for a long time. You need three things:

1. First a keyboard that captures the pressing down of keys. Today you would probably select a midi keyboard with USB connection. You may check this website to get an overview what is available in the market. [Example of large webshop to get an overview of what is available, not a recommendation](https://www.thomann.de/se/midi_masterkeyboards.html)
2. Secondly you need a computer. Most computers made the last ten years or even more will do. (And mouse, screen). Internet connection helps.
3. The third part is a program that can do the translation. All of the three "professional" programs does this (Finale, Sibelius, Dorico). At least one of them has a free version (Dorico SE) which you simply download.The free program Musescore is another example that can do it. There are quite a few other programs available that can do similar things, almost all so called DAW-s can do it. (And I have probably forgotten a dozen or more programs).

My general experience is that it can take a bit of work to create a good looking score from my fumbling on the keyboard, but that is me.
This solution might involve a bit of a learning curve, but there is some software called [Lilypond](https://lilypond.org/) for typesetting music-notation, and it has a GUI frontend program called [Denemo](http://denemo.org/). In Denemo you can play midi into it and generate beautiful/professional scores. Lilypond/Denemo have an intimidating number of features.

Here are a couple of demo videos of someone using a midi-keyboard to enter notes:

[http://www.denemo.org/~rshann/PitchesFirst.mp4](http://www.denemo.org/%7Ershann/PitchesFirst.mp4)

<https://vimeo.com/62188678>

Caveats:

* I've used Lilypond but haven't actually tried Denemo
* The workflow is a bit clunky-looking
* I am not affiliated with either of these programs in any way.

Other software with similar features:

* Finale can import MIDI files but you can't type in MIDI directly.
* I believe even the free version of Avid's Sibelius software *does* support entering MIDI directly.