There is already a crude toy out there that will 'read your mind' and raise or lower a ball based on a signal you send it, you just train it to a binary state. I've heard it described as mellowing out vs concentrating hard.
There's no reason in principle that a reader with fine enough discrimination couldn't be trained to recognize a few hundred states, and you couldn't be trained to 'think' a few hundred things, where the reader would recognize and translate the pattern into a number, letter, or symbol. I'm no neurologist so I have no idea how these things actually work, but it seems easier in theory than understanding the whole of brain and language.
Edit: Note, I can imagine the need for direct text input being reduced over the next 20 years thanks to UI changes ("Select your house on this map" replacing "Type your address in this box", for example), but I don't think that the keyboard will go away as the main tool for doing it when it is needed.
Also, it's nice to be able to slap the backspace key really hard.
Say no to psychodongles.
I'm fine with such direct brain interfaces, as long as they don't have to cut a hole in my head, or shave my hair off and put sticky stuff on my head :P
The other question is: how common will generation of long form text be? Is Twitter the future? I hope not, but many appear to think it is. Many keyboard alternatives are good enough, even today, for Twitter.
One interesting thing to me is that, even though most people don't use Model Ms anymore, there's still a robust niche that does, or that seeks out weird and alternate keyboards. I write a blog that's chiefly about books, but by far the most visited post of all time is this review: http://jseliger.com/2008/05/07/product-review-unicomp-custom... of the Unicomp Customizer / Space Saver, which are modern Model Ms.
The other question is: how common will generation of long form text be?
Probably common enough, especially in school settings. I tend to agree with the OP: unless we see some kind of neural interface (which doesn't appear especially likely to me, although I'd love to be wrong), I don't see keyboards disappearing.
Otherwise, there's simply no faster and more precise method of text input at the moment, and nothing that I've even seen hinted at in the research labs.