It's all in the fabulous manual. Your distribution hopefully came with a copy, perhaps you have to build it, but one version can be found on liballeg.org (or indeed, also there should be one still on allegro.cc).
The low byte of the return value contains the ASCII code of the key, and the high byte the scancode. The scancode remains the same whatever the state of the shift, ctrl and alt keys, while the ASCII code is affected by shift and ctrl in the normal way (shift changes case, ctrl+letter gives the position of that letter in the alphabet, eg. ctrl+A = 1, ctrl+B = 2, etc). Pressing alt+key returns only the scancode, with a zero ASCII code in the low byte.
This paragraph is followed by example code that demonstrates, but I'll blabber one with my own explanation inline.
The >> operator shifts the bits in the left operand (value) to the right by the right operand. In this case, x >> 8 means to move all of the bits in x to the right 8 places, effectively erasing the bottom 8 bits, and moving the 8-32 bits to positions 1-24, respectively (for a 32-bit integer) (using a 1-based index, which is somewhat weird probably).
0001000101010101 >> 8
The & operator is a bitwise-AND. This compares the bits in the left-hand operand with the corresponding bits in the right-hand operand. If they're both 1 then the result is 1. If either is 0 then the result is 0. Just like a standard AND logic gate.
0xff AKA 255 represented in binary in a 32-bit signed integer is 00000000000000000000000011111111 (all 8 lowest bits set to 1). This is just another trick to discard the parts you don't care about (the upper bits) and keep the ones you do care about (the bottom 8). Any bits in the other operand that are set in the lowest 8 positions are kept, and the rest are thrown away. This leaves you with only the part that you care about.