CompuServe Thread

#Setmap in C

5 messages in this thread
#19222From: Henry WilliamsJan 20, 1992 4:05 PM
Hi! Can someone tell me how to check and (if I want) set the keymap? I'm writing a few programs that will need to change the users keymap but I couldn't figure out how to do it. I wanted to try the dos setmap command, but the answer evades me. While in the same area, is there a way to use the other commands of the c: directory in our C programs? Thanking you in advance for your advice… Henry Williams
#19224From: John Toebes/SYSOPJan 20, 1992 5:12 PM
I can certainly help on the Setmap issue. What is it exactly that you want to do. Are you trying to ensure that they are using a specific map like USA0? Is this because the program expects specific keys to produce specific key codes?
#19270From: Henry WilliamsJan 21, 1992 2:49 PM
Hi John. Yes that is exactly it. I live in Montreal, Quebec and I'm sure you know there is a large french population here. So, I'm trying to write bilingual programs. My programs use the USA0 map which happens to be more complete than either the French or French Canadian keymaps. (Way to go you US'ers). I found the problem when I tried to run my program off WorkBench 1.2 and found the ALT + keys either in the wrong places, or non existent. Ultimately, I want to 1) check which keyboard is in effect, 2) check to see if USA0 is available, 3) set USA0 keymap for my program, 4) and finally reset their original keymap back before exiting my program. I'm presently running Manx 3.6a off a 3000. Would sure appreciate your help, thanks. Henry
#19274From: John Toebes/SYSOPJan 21, 1992 7:12 PM
Actually, I was expecting you to say this. If you are going to the trouble of forcing the keymap to a particular one, I might suggest that either (a) the existing keymap for the language is deficient and should be improved or (b) you might want to look at the problem differently. In general, keymaps are there to provide a mapping of keycaps to the represention of data. In a number of cases we have keycaps that are swapped (like z and y on the german keyboard). You might want to seriously look at rawkeys as your input mechanism and using rawkeyconvert to get the data that you want. WHat this gives you is the ability to prefilter things like ALT or Control but still allow whatever keymapping is in force. This is the much more system friendly way of making things happen. I actually wrote a program called GSETMAP that will set the keymap on everything in the system at once. It is not a pretty task to do, but you can draw from it to do your own task. I STRONGLY recommend that you do not take this route however because of the potential confusion to the user in switching keymaps on the fly. If you are only trying to add some guarenteed shortcut keys, the rawkey/keyconvert is the way to go.
#19377From: Henry WilliamsJan 24, 1992 3:08 PM
Ok thanks John. I haven't tried programming in RAW mode yet but I guess it's about time. I'll get back to you if I can't figure out how to do it. Take care. Henry