get keyboard info
| 1118 | |
| 1119 | // get keyboard info |
| 1120 | float gameWinController::get_key_value(int key, ct_format format) { |
| 1121 | float val = (float)0.0; |
| 1122 | |
| 1123 | ASSERT(key < DDIO_MAX_KEYS); |
| 1124 | |
| 1125 | switch (format) { |
| 1126 | // note we take care of mouse controls and external controls here |
| 1127 | case ctDigital: |
| 1128 | if (KEY_STATE(key)) |
| 1129 | val = 1.0f; |
| 1130 | break; |
| 1131 | |
| 1132 | case ctDownCount: |
| 1133 | val = (float)ddio_KeyDownCount(key); |
| 1134 | break; |
| 1135 | |
| 1136 | case ctTime: |
| 1137 | val = (float)ddio_KeyDownTime(key); |
| 1138 | break; |
| 1139 | |
| 1140 | default: |
| 1141 | mprintf(1, "gameController::key unsupported format for function\n"); |
| 1142 | } |
| 1143 | |
| 1144 | return val; |
| 1145 | } |
| 1146 | |
| 1147 | int gameWinController::assign_function(ct_function *func) { |
| 1148 | // for now this is a straight forward translation (that is, no mapping of needs to controller |
nothing calls this directly
no test coverage detected