MIDI keyboard
A MIDI keyboard or controller keyboard is typically a piano-style electronic musical keyboard, often with other buttons, wheels and sliders, used for sending MIDI signals or commands over a USB or MIDI 5-pin cable to other musical devices or computers. MIDI keyboards lacking an onboard sound module cannot produce sounds themselves, however some models of MIDI keyboards contain both a MIDI controller and sound module, allowing them to operate independently. When used as a MIDI controller, MIDI information on keys or buttons the performer has pressed is sent to a receiving device capable of creating sound through modeling synthesis, sample playback, or an analog hardware instrument. The receiving device could be: 
a computer running a digital audio workstation (DAW) or a standalone VST/AU instrument (alternatively, the computer could be used to re-route the MIDI signal to other devices)
a sound module
a digital (digital piano/stage piano) or analogue (synthesizer) hardware instrument with MIDI capability, such as a drum machine

While many digital and analog hardware keyboards in the aforementioned categories of digital piano, stage piano, and synthesizer can be used as MIDI controllers if they have MIDI capability, they often do not offer the same level of software integration and number of MIDI-mappable controls as a dedicated MIDI keyboard. MIDI keyboards are often utilized by individuals who work with DAWs and software instruments, from hobbyists to professional musicians working in recording studios or concert stages.

Signal flow: MIDI keyboard to audio
Below is an example of possible signal chains for a MIDI keyboard setup, with the goal of producing audio:

MIDI Keyboard → 5-pin MIDI connector OR USB cable (will need a “B” connector, so "USB A to B" or "USB C to B", depending on computer) → computer running a DAW or a standalone VST/AU instrument OR a sound module OR a digital piano, stage piano, or synthesizer with MIDI capability → audio sound device (amplifier and speakers or headphones)

Class compliance and power source
When using a MIDI keyboard with a computer, class compliance must be taken into consideration. Class compliant means, essentially, "plug and play": upon being plugged in (USB or 5-pin) and powered up, MIDI keyboards that are class compliant should be recognized by any computer. MIDI keyboards and MIDI-capable hardware keyboards that are not class compliant require a keyboard-specific software driver to be installed on the computer in order for the keyboard to be recognized.

While most MIDI keyboards produced in the 2010s are bus-powered, meaning their electrical power is supplied through the same USB connection that transfers MIDI data to the computer, some keyboards have the option of, or even require, using external power to operate. If using a traditional 5-pin MIDI connector instead of USB, the MIDI keyboard will likely require external power, as 5-pin MIDI connections cannot send the current needed to power a keyboard. If using a MIDI-capable hardware keyboard as a controller, one will also likely need external power, as most 2010s hardware keyboards rely on external power to function.

Keyboard action 
The action of a keyboard is the internal mechanism by which the keys work in order to move and produce sound, or, in this case, MIDI data. Two major types of keyboard actions exist: those derived from traditional, European, key-based instruments and non-traditional, contemporary designs that allow for expanded playing possibilities.

Traditional
MIDI controllers in this category have keys meant to resemble those of a grand piano, pipe organ, or synthesizer. Each of these action types is designed differently from the next, which, in turn, gives the action a particular "feel" to the player and lends it to an ideal usage.
 Synth action: un-weighted, often spring-loaded— ideal for music that calls for playing quickly, and may be favored by those with no piano or keyboard experience due to less required effort to depress the keys. Synth action is generally less expensive and weighs less than its weighted key counterpart.
 Semi-weighted action: similar to synth action, but with slightly increased resistance— also ideal for playing quickly, but allows for more dynamic playing on velocity-sensitive sound patches due to increased feedback from the keys
 Waterfall keys: semi-weighted keys with smoothed and rounded edges— meant for emulating organ keys (i.e. Hammond B-3 organ) and ideal for playing organ-specific techniques (i.e. palm glissando/smears)
 Hammer action: piano-style action with fully weighted keys— meant to provide resistance similar to an acoustic piano action and ideal for playing piano or electric piano instrument patches
 Graded hammer action: hammer action with graded resistance— keys in the upper register are lighter than keys in the lower register, and resistance increases incrementally as one descends the keyboard from high to low, like an acoustic piano action (e.g. grand piano)
 Graded hammer action with wood: graded hammer action with wooden key cores— the closest in realism to an acoustic piano action (as acoustic piano keys are made of wood)

Many examples of the above actions, other than the waterfall keys, will include a small lip that protrudes from the top of the distal end of the white keys. This is emulating a customary design detail found on acoustic piano keys. Keyboards with any type of hammer action are most likely to display this lip.

Sensor type

When a Musician presses a key three things can happen: 1- How fast the key is pressed, is called 'Attack Velocity', 2 - After the key is pressed, it can be held down and pressed harder or softer, this is called 'Key Pressure' or sometimes 'Channel Pressure' if it affects all the keys on the keyboard, and 3 - how fast the key is released, is called 'Release Velocity'. Inexpensive keyboards have no velocity reporting. Quality keyboards have Attack Velocity. Industrial and Professional Keyboards have both Attack Velocity and Key Pressure, and only a handful of very exotic and expensive keyboards have release velocity. Unfortunately, every manufacturer refers to these three key abilities by different names.  Some manufactures refer to 'Key Pressure' as 'After Touch'.

Most of these traditional key keyboards determine the attack velocity, sustain, and release of a note based on a calculation made between two sensors in each key. Some high-end keyboards now feature triple sensors, claiming improved accuracy in the tracking of key movement, which could translate into a more detailed, and perhaps more expressive, performance.

Aftertouch
Some MIDI keyboards are capable of sending aftertouch data, which can be assigned to a variety of effects, including: vibrato, pitch bends, and volume swells. Aftertouch data is generated when a key is depressed further into the keybed after its initial depression (without releasing the key). Keyboards can be equipped with channel or polyphonic aftertouch. The former sends only one aftertouch message, regardless of which key is depressed; the latter sends individual aftertouch messages for each key. Keyboards with every key aftertouch can enable the performer to create aftertouch effects on particular notes, such as emphasizing a melody note by continuing to press it.

Non-traditional

Not all MIDI keyboards utilize variations on the traditional piano-style action. One example of a MIDI keyboard with a non-traditional action is the Continuum Fingerboard, which is based on a "fretless" type keyboard interface, enabling portamento style note changes at will during play.  Another unconventional MIDI keyboard is the Tonal Plexus keyboard, which provides for up to 1266 different pitches possible through the TPX6 1266 Keys (Microtonal MIDI Controller).

The ROLI Seaboard line of MIDI keyboards has soft, squishy keys, that have a foam rubber-like texture. 

All the above-mentioned MIDI keyboards take the concept of aftertouch to new heights: for instance, the Roli Seaboards can sense left-to-right, front-to-back, downward pressure/depth, and the rate of change in each of these parameters. All that information can then be used to control the behavior of a digital instrument.

Size and number of keys

MIDI keyboards come in a wide range of sizes and number of keys, each with their own benefits and drawbacks. Generally speaking, some sizes are more common while others are less common, both in online stores and in bricks and mortar music stores.

Common
 25-key: generally the smallest MIDI keyboard available— portable and light, but only suitable for playing one-handed piano parts such as basslines.
 49-key: considered the smallest MIDI keyboard size upon which to play two-handed piano parts effectively.
 61-key: ideal size for playing two-handed piano parts— same key count as a single manual from a classic organ like the Hammond B-3. 
 88-key: full key range— same key count as an acoustic piano— the "gold standard" when playing piano and electric piano, but least portable and heaviest of the MIDI keyboards.

Uncommon

 32 & 37-key: compared to 49-key keyboards, these are more compact and easy to carry. Compared with a 25-key keyboard, they offer a greater range
 64-key: Roland has a 64 keys hammer-action keyboard (RD64 ) which is more compact than regular 88-keys
 73 & 76-key: compared to 88-key keyboards, these are more compact and easy to carry. Compared with a 61-key keyboard, they offer a greater range
 modular some small manufacturers are making collapsible keyboards (Kombos, Piano de Voyage), made of sections of 1 to 2 octaves. These keyboards are focused on portability

Most 25-key through 49-key keyboards come equipped with synth or semi-weighted actions. Most 49-key and 61-key keyboards come equipped with semi-weighted actions, but some may be found with hammer actions. Waterfall keys can be found occasionally on some 61-key and 73-key keyboards. Most 73-key through 88-key keyboards come equipped with hammer actions; however, some may be outfitted with semi-weighted actions.

Key size
MIDI keyboards are usually full-size keys, like a grand piano. Some smaller keyboards use minikeys, which are smaller. Some tiny keyboards have flat minikeys which are even smaller.

Controls (buttons, knobs, faders, wheels)
Many MIDI keyboards include control devices (other than the keys), which may allow for manipulation of DAW controls and/or the sound generator (either software or hardware). Provided they are mapped, or mappable, to the correct function, these allow the player to access a DAW or alter the sound of an instrument patch without taking hands off the keyboard.
 Buttons: may be assignable or allow for editing of menus, settings, MIDI CC information, splits, use of DAW transport controls, transpose function, or octave up/down
 Knobs: either potentiometers or endless encoders— typically assignable to a function
 Sliders/faders: typically assignable— common assignments are as drawbars for an organ, to control channel faders, or to control equalizer (EQ)
 Pitch bend and modulation: allows for control of pitch bending and modulation via one of several control setups...
 Traditional two wheels: spring-loaded pitch bend wheel and a modulation wheel
 X/Y joystick: capable of rotation in a full circle— pitch bend and modulation are mapped out on an X/Y plot
 Roland-style pitch/modulation: spring-loaded, three-directional lever— left-to-right for pitch bend and up for modulation
 Nord pitch stick & modulation: tensioned wooden stick that moves left-to-right for pitch bend— traditional modulation wheel (made of ceramic)
 Touch strips: touch-sensitive strips assignable to several functions— less common on most keyboards
 Pads: velocity-sensitive, rubberized pads— can be assigned to trigger events from drum hits to patch changes
Breath controller: A device which involves a mouthpiece which is gripped by the teeth or held in front of the mouth with a holder; by blowing into it, the user can control synth tones. It can be used to give a vocal, singing quality to notes played on a keyboard
 Screens: depending on make and model, some keyboards have no touchscreen, such as with 1980s LCD screen— others have touch screens that intuitively interface with companion software
Software integration: A MIDI keyboard offers an automatic configuration option to integrate with a DAW.

Foot controllers
MIDI keyboards often have the ability to accept foot controllers, of which there are four main types: piano pedals, expression pedals, stomp boxes, and organ-style foot pedal keyboards.
 Piano pedals: can be a single sustain pedal (two types) or up to a full grand piano-style triple pedal, with sostenuto and una corda pedals, like an acoustic piano
 Sustain pedals: Momentary sustain pedals only send a message when the pedal is on or off. Continuous sustain pedals send a real-time MIDI value of the sustain pedal's position, allowing for realistic tracking of the pedal's movement (provided the controller and sound source support continuous sustain).
 Expression pedals: send a continuous MIDI value that can be mapped to control parameters like volume (a "swell pedal"), effects (chorus, reverb, etc.), and patch changes
 MIDI stomp boxes: similar in form to a guitar pedal board, but are configurable to send MIDI commands for various actions (i.e. patch changes, looping, or playing chords)
 Organ foot pedal keyboards: traditional organ pedal keyboards for those used to playing Hammond B3's or church organs. While they are intended to send MIDI values for organ bass notes, if they are hooked up to a DAW, the pedals can trigger chords or play a high-pitched melody. The 12 Step foot controller can be programmed to play a wide range of pitches, from deep-pitched basslines to high-pitched melodies. As well, the 12 Step's individual Keys can be programmed to play chords with up to five notes.

References

External links 

MIDI Keyboard Limits, an interactive animation by Michael Schreiber, The Wolfram Demonstrations Project, 2007.
Why MIDI matters (midi.org)

Keyboard instruments
MIDI controllers
Electric and electronic keyboard instruments