|
FuhQuake
https://fuhquake.net
|
View previous topic :: View next topic |
Author |
Message |
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Sat Sep 27, 2003 7:28 pm Post subject: FuhQuake v0.31 with keymap support |
|
|
Here are again my FuhQuake-executables which include the possibility to change the keyboard to fit your local needs.
With that feature you can easily create a new mapping for a non QWERTY-keyboard.
All three levels (normal, with shift, with altgr) are possible and you are also able to switch on an output of the pressed and released scancodes.
This helps creating new keymap files.
The feature is similar to ZQuake's keymap-feature (loadkeys command) but the keymap-files have a slightly different syntax (which newer ZQuake versions also support).
It's easy to port existing older zquake-maps to the new syntax.
Look at the FuhQuake-Massas_Changes.txt and FuhQuake-keymap.txt inside the ZIP and also in the commented header of the example keymap-files (german, dvorak, uk, hungarian and the default.kmap as base for own changes).
Have a look at FuhQuake-Massa_History.txt for a chronological ordered list of changes (started at 2003/07/01)
Here we go:
Win32-versions:
Linux-versions ( Note: I've no idea if my compiled versions will run anywhere else - try if you like experiments )
if you just want the keymap-files (currently german, dvorak, uk and hungarian are included):
Also included in the package are updated qwprogs.dat and spprogs.dat;
they are directly compiled versions from Tonik's CVS - look at progs-version.txt to identify the exact CVS date on which they are based (normally I keep them always up to date).
They can be used in fuhquake as well as in zquake and it should also be possible to use them in other QW based engines (although they may not use spprogs.dat for single player games).
Additionally there is a directory qc.tst which contains slightly modified versions of qwprogs.dat and spprogs.dat (but still compatible). They contain a few extentions which all can be configured and switch on/off with certain serverinfo variables.
Look at progs.changes.txt in that directory for detailed informations.
If you just want the qwprogs.dat and spprogs.dat files (the original and the changed ones) download them here:
Please post your comments, problems and other things related to the keymap-features here!
If you're interested in the source code of my FuhQuake-version, you can also download it here:
Note: the corresponding QuakeC sources for building qwprogs.dat and spprogs.dat are also included.
There are a few notes about how to compile the stuff in the file FuhQuake-Massas_Sources.txt (you can find it in the subdir "doc").
What else changed since last release?
This version has lesser changes to the original sources than the last version.
Why? Because most of the things are now already contained in the official FuhQuake
Here are the some of the entries from the history file:
26 Sep 2003 (v0.30 build 577-MM):
# fixed "mouse buttons 4/5 send release event when pressing button" bug which occurs in some configuration with MS IntelliMouse Explorer (I hope this one line fix has no side effects).
# fixed a bug in my keymap code which made release events occur twice (forgot to comment out a few lines)
+ added command m_accel (default:0) for mouse accelaration, as suggested by Fuh at the forum. Added a factor 10 to the values; they should now be similar as in Quake3.
Theoretically the addition is also included in the Unix-code, but I'm unable to test it...
+ reorganized the keymap code. The main part is now in keymap.c and keymap.h
+ Another update to the qwprogs.dat and spprogs.dat according to Tonik's CVS.
Note: About a Unix version: I personally think that most of the keymap features do not make sense in a Unix version (correct me if I'm wrong).
But I also think that the configurations should be portable between windows and Unix.
So I'll try to partially add the keymap stuff to the Unix version.
cl_show_keycode should work in the X11 versions and the other keymap command are only wrappers so that the commands are available but do nothing
29 Sep 2003 - Update:
# I now fixed keymap_x11.c and it does compile under linux here (X11 and GLX version).
Note: the compiled svgalib version is also included but I'm still unable to use svgalib binaries (my computer crashes when I use _any_ svgalib based library).
And there's also no keymap code in it - so to use this executable is just for me to know if it works elsewhere
06 Oct 2003 - Update:
new base of code is now official FuhQuake v0.30-Build585.
- remove of "mouse button 4/5"-fix - now also in official version.
+ added aliases WINKEY, LWINKEY, RWINKEY, POPUPMENU for the existing keycodes
WIN, LWIN, RWIN, MENU to allow the same names as Fuh choosed as bind keys.
- still no support for svgalib version
(just to remember that I still need help from somebody with working svgalib configuration )
11 Oct 2003 - Update:
small bugfix for the problem, that the aliaslist could not be saved with cfg_save (even if "cfg_save_aliases 1" has been set).
This was already fixed in the official Fuhquake Build 585, but I missed the corresponding sourcecode.
Now the fix is also included in my version
16 Jan 2004 - Update:
new base of code is now official FuhQuake v0.31-Build650.
- removed code for "mouse acceleration" - now part of the official version.
+ keymap-files can now also be placed in subdirectory "keymaps" (subdirectory of usual places, that means "qw", "id1", "fuhquake").
+ added code for support of IntelliMouse (and hopefully others) buttons 5-8 with "-dinput"!
This code came originally from BorisU's client qw262. I extended it a little bit, so that it's now able to link the beast without dependency to "dinput.lib" --> the executables will still work on NT4. After that change it needs at least DirectX7 to work; as a consequence "-dinput" does not work with NT4 (but the executables itself do, only that DirectInput mode does not!).
+ added a (hopefully) faster Q_strncpyz function; this has been discussed at Tonik's ZQuake forum.
+ extended the size of the console buffer from 32KB to 64KB (following Tonik's suggestion from ZQuake).
+ new cvar gl_textures_dir to add an additional directory for searching texture files.
With that you can easily switch between different texture sets without changing the gamedir (e.g. useful when using Drugs-Bunny's simplequake textures)!
+ Win32: internal compares for textures, directories, files are now case insensitive - not complete and not very well tested -> comments are welcome 21 Jan 2004 - Bugfix Update:
# the last version broke the screenshot functionality - fixed.
- most part of my Q_strncpyz has been removed again - it was 5-10fps slower than the original code.
# changed completely the code of the gl_textures_dir functionality.
The new code is now able to handle also pakfiles in the textures dir and also loads textures from the given dir if it's not available in the requested dir
(e.g. if there is no basedir/textures/mapdir/name but there is a basedir/textures/name)
-> it works exactly the same as the normal loading mechanism
The code has more work to do and therefore is slower; that means the loading of textures will be slower, but that should not be a problem.
# a bugfix in both versions of the qwprogs.dat (qw and qw.tst directory): the function GotoNextMap will hopefully not be called twice any more in some situations.
# bugfix in my version of the qwprogs.dat (qw.tst directory): the random mapchange did not always select the maps in a counterbalanced order.
Now it should do.
As always ==> enjoy
Last edited by Massa on Wed Feb 11, 2004 7:12 am; edited 6 times in total
|
|
Back to top |
|
|
oldman
Joined: 10 Sep 2002
Posts: 636
|
Posted: Sat Sep 27, 2003 7:55 pm Post subject: |
|
|
i wonder if this will ever finally get in the authorized release :)
thanks as usual Massa
proper " placement \o/ |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Sun Sep 28, 2003 4:18 am Post subject: |
|
|
Quote: |
i wonder if this will ever finally get in the authorized release |
As always: it depends on Fuh and I'll to my best that the code will complete his requirements (currently I do some reorganization of the keymap code to be better separated and I also did some reforming of the source code to fit better fuh's source conventions )
Quote: |
thanks as usual Massa |
You're welcome
Quote: |
proper " placement \o/ |
???
|
|
Back to top |
|
|
oldman
Joined: 10 Sep 2002
Posts: 636
|
Posted: Mon Sep 29, 2003 4:12 am Post subject: |
|
|
uk keyboard has the " as shift+2 :) |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Tue Sep 30, 2003 8:00 am Post subject: |
|
|
Small update:
The linux versions compile now with keymap support
(to be precise: most of the keymap functions are only wrappers - functionality is not needed under X11 )
For details look at the beginning of the thread... |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Tue Oct 07, 2003 7:17 am Post subject: |
|
|
Another update:
Now base of code is official FuhQuake v0.30 Build585.
For other things look at the beginning of the thread... |
|
Back to top |
|
|
Rowdy
Joined: 22 Apr 2003
Posts: 7
|
Posted: Sat Oct 11, 2003 5:28 am Post subject: Thanks again |
|
|
Massa,
As always, I am grateful that you provide a FuhQuake with keymap support, and I hope that your changes will be incorporated into the main FuhQuake distribution soon. |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Sun Oct 12, 2003 5:10 am Post subject: |
|
|
Another small fix for a irritating bug for which I didn't have the already fixed source (bug was in build 570 and was fixed in 585, but I missed it so in my version the bug still existed )
I'm talking about the bug that cfg_save does not save the aliaslist, even when "cfg_save_aliases 1" has been set.
Look at this thread for more information:
https://fuhquake.net/forum/viewtopic.php?t=1936
Sorry for all disagreeableness ! |
|
Back to top |
|
|
midn
Joined: 27 Sep 2003
Posts: 97
Location: Rio de Janeiro - Brasil
|
Posted: Mon Dec 29, 2003 4:44 pm Post subject: |
|
|
Hi massa
I bought a ms4.0 mouse and worked fine in fuhquake, using -dinput even the mouse4 worked fine but no mouse5 as i expected(Is there a way to make it work?), and without -dinput all buttons worked (mouse1-5)
but if u don't know this mouse has the feature to scroll horizontally the screen and i'd like to know if is possible to make it able to bind
like mwhellright ; mwhellleft
it'd be great and useful
1- is there a way to make mouse5 work with -dinput?
2- and about to make the horizontal wheel bindable?
btw im using the software that came with the mouse, intellipoint 5.0
tkz massa
mouse: www.paolopuc.hpg.ig.com.br/mfuh.jpg (use br proxy if it not open) |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Mon Dec 29, 2003 10:37 pm Post subject: |
|
|
Hi midn,
1 - If you know a programmable way to access more than four MS-mouse buttons in dinput-mode, tell me.
I didn't find any feasable documentation in the SDK
2 - maybe; but I don't have such a mouse so I can't make any tests to find out which events will be sent with that additional wheelbuttons (are they wheelbuttons? Or are they normal buttons?).
If you'll buy me such a mouse I'll promise to have a look at that issue |
|
Back to top |
|
|
BorisU
Joined: 08 Sep 2002
Posts: 128
Location: Moscow, Russia
|
Posted: Mon Dec 29, 2003 11:00 pm Post subject: |
|
|
I have made some modifications in QW262 in DirectInput code and now 5 buttons are working. source is available |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Mon Dec 29, 2003 11:16 pm Post subject: |
|
|
BorisU wrote: |
I have made some modifications in QW262 in DirectInput code and now 5 buttons are working. source is available |
Cool!
I'll have a look at it and then post the results here.
But not this year
|
|
Back to top |
|
|
midn
Joined: 27 Sep 2003
Posts: 97
Location: Rio de Janeiro - Brasil
|
Posted: Tue Dec 30, 2003 1:39 am Post subject: |
|
|
Massa wrote: |
Hi midn,
1 - If you know a programmable way to access more than four MS-mouse buttons in dinput-mode, tell me.
I didn't find any feasable documentation in the SDK
2 - maybe; but I don't have such a mouse so I can't make any tests to find out which events will be sent with that additional wheelbuttons (are they wheelbuttons? Or are they normal buttons?).
If you'll buy me such a mouse I'll promise to have a look at that issue |
lol massa
if it was possible i'd buy it for u
but was very difficult to buy it for me, imagine for u hehe
and tell me
what exactly -dinput do? cant u change some "details" in this feature?
And u said the same thing that fuh said, u dont have the mouse in hand to make it work
and im able to help online whenever u tell me to help, contact me via icq to try to make something
tkz massa :O
|
|
Back to top |
|
|
fuh
Almighty King
Joined: 07 Sep 2002
Posts: 2086
|
Posted: Tue Dec 30, 2003 9:46 pm Post subject: |
|
|
Actually I remember borisu telling me he has solved this already. I will paste a rough diff (not for fuhquake sources but you should be able to read it and apply it manually) for massa to try:
Code: |
diff -u -w -r1.4 -r1.7
--- source/src/in_win.c 2 Dec 2003 20:17:29 -0000 1.4
+++ source/src/in_win.c 20 Dec 2003 10:05:41 -0000 1.7
@@ -20,21 +20,19 @@
// in_win.c -- windows 95 mouse and joystick code
// 02/21/97 JCB Added extended DirectInput code to support external controllers.
-#include <dinput.h>
+#define DIRECTINPUT_VERSION 0x700
+
+#include "dinput.h"
#include "quakedef.h"
#include "winquake.h"
//#include "dosisms.h"
#define DINPUT_BUFFERSIZE 16
-#define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)
-
-HRESULT (WINAPI *pDirectInputCreate)(HINSTANCE hinst, DWORD dwVersion,
- LPDIRECTINPUT * lplpDirectInput, LPUNKNOWN punkOuter);
-static LPDIRECTINPUT g_pdi;
-static LPDIRECTINPUTDEVICE g_pMouse;
+static LPDIRECTINPUT7 g_pdi;
+static LPDIRECTINPUTDEVICE7 g_pMouse;
static JOYINFOEX ji;
@@ -124,37 +122,6 @@
static qboolean dinput;
-typedef struct MYDATA {
- LONG lX; // X axis goes here
- LONG lY; // Y axis goes here
- LONG lZ; // Z axis goes here
- BYTE bButtonA; // One button goes here
- BYTE bButtonB; // Another button goes here
- BYTE bButtonC; // Another button goes here
- BYTE bButtonD; // Another button goes here
-} MYDATA;
-
-static DIOBJECTDATAFORMAT rgodf[] = {
- { &GUID_XAxis, FIELD_OFFSET(MYDATA, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE, 0,},
- { &GUID_YAxis, FIELD_OFFSET(MYDATA, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE, 0,},
- { &GUID_ZAxis, FIELD_OFFSET(MYDATA, lZ), 0x80000000 | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0,},
- { 0, FIELD_OFFSET(MYDATA, bButtonA), DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0,},
- { 0, FIELD_OFFSET(MYDATA, bButtonB), DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0,},
- { 0, FIELD_OFFSET(MYDATA, bButtonC), 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0,},
- { 0, FIELD_OFFSET(MYDATA, bButtonD), 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0,},
-};
-
-#define NUM_OBJECTS (sizeof(rgodf) / sizeof(rgodf[0]))
-
-static DIDATAFORMAT df = {
- sizeof(DIDATAFORMAT), // this structure
- sizeof(DIOBJECTDATAFORMAT), // size of object data format
- DIDF_RELAXIS, // absolute axis coordinates
- sizeof(MYDATA), // device data size
- NUM_OBJECTS, // number of objects
- rgodf, // and here they are
-};
-
// forward-referenced functions
void IN_StartupJoystick (void);
void Joy_AdvancedUpdate_f (void);
@@ -358,7 +325,8 @@
}
}
+static HRESULT (WINAPI *pDirectInputCreateEx)(HINSTANCE hinst, DWORD dwVersion,
+ REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
/*
===========
@@ -570,50 +537,43 @@
DINPUT_BUFFERSIZE, // dwData
};
- if (!hInstDI)
- {
+
+ if (!hInstDI) {
hInstDI = LoadLibrary("dinput.dll");
- if (hInstDI == NULL)
- {
+ if (hInstDI == NULL) {
Con_SafePrintf ("Couldn't load dinput.dll\n");
return false;
}
}
- if (!pDirectInputCreate)
+ if (!pDirectInputCreateEx)
{
- pDirectInputCreate = (void *)GetProcAddress(hInstDI,"DirectInputCreateA");
+ pDirectInputCreateEx = (void *)GetProcAddress(hInstDI,"DirectInputCreateEx");
- if (!pDirectInputCreate)
+ if (!pDirectInputCreateEx)
{
Con_SafePrintf ("Couldn't get DI proc addr\n");
return false;
}
}
-// register with DirectInput and get an IDirectInput to play with.
- hr = iDirectInputCreate(global_hInstance, DIRECTINPUT_VERSION, &g_pdi, NULL);
+// register with DirectInput and get an IDirectInput to play with.
+ hr = pDirectInputCreateEx (global_hInstance, DIRECTINPUT_VERSION, &IID_IDirectInput7, &g_pdi, NULL);
if (FAILED(hr))
- {
return false;
- }
// obtain an interface to the system mouse device.
- hr = IDirectInput_CreateDevice(g_pdi, &GUID_SysMouse, &g_pMouse, NULL);
-
- if (FAILED(hr))
- {
+ hr = IDirectInput7_CreateDeviceEx (g_pdi, &GUID_SysMouse, &IID_IDirectInputDevice7, &g_pMouse, NULL);
+ if (FAILED(hr)) {
Con_SafePrintf ("Couldn't open DI mouse device\n");
return false;
}
// set the data format to "mouse format".
- hr = IDirectInputDevice_SetDataFormat(g_pMouse, &df);
-
- if (FAILED(hr))
- {
+ hr = IDirectInputDevice_SetDataFormat(g_pMouse, &c_dfDIMouse2);
+ if (FAILED(hr)) {
Con_SafePrintf ("Couldn't set DI mouse format\n");
return false;
}
@@ -621,9 +581,7 @@
// set the cooperativity level.
hr = IDirectInputDevice_SetCooperativeLevel(g_pMouse, mainwindow,
DISCL_EXCLUSIVE | DISCL_FOREGROUND);
-
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
Con_SafePrintf ("Couldn't set DI coop level\n");
return false;
}
@@ -632,9 +590,7 @@
// set the buffer size to DINPUT_BUFFERSIZE elements.
// the buffer size is a DWORD property associated with the device
hr = IDirectInputDevice_SetProperty(g_pMouse, DIPROP_BUFFERSIZE, &dipdw.diph);
-
- if (FAILED(hr))
- {
+ if (FAILED(hr)) {
Con_SafePrintf ("Couldn't set DI buffersize\n");
return false;
}
|
Of course I will try it too, but I don't have access to any intellimice like massa does.
edit: Oh I just noticed borisu has replied already . He will be help you if you have problems much better than me. The changes seem to compile fine for me, except I needed to add dinput.lib .
|
|
Back to top |
|
|
midn
Joined: 27 Sep 2003
Posts: 97
Location: Rio de Janeiro - Brasil
|
Posted: Wed Dec 31, 2003 5:19 am Post subject: |
|
|
tkz for starting helping me guys |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Fri Jan 09, 2004 5:42 am Post subject: |
|
|
I had an intense look at BorisU's changes.
Precisely considered it changes only a few common DirectX structures and functions to its DirectX7 counterpart (e.g LPDIRECTINPUT mutates to LPDIRECTINPUT7)
And it uses the extended function instead of the simple ones (e.g. pDirectInputCreateEx instead of pDirectInputCreate)
Now I have some questions to BorisU:
Is this understanding correct?
Is this really all we need to detect and use more than 4 IntelliMouse-buttons?
Additionally:
Does these DirectX conversions mean that a version build with that code will no longer work under NT4?
Or was the original code already unable to work with NT4?
I did not have time to test the code in real life (I currently have to test something else ),
t's all just about looking at the source changes.
I really wonder if it's such easy ???!! |
|
Back to top |
|
|
fuh
Almighty King
Joined: 07 Sep 2002
Posts: 2086
|
Posted: Fri Jan 09, 2004 10:15 am Post subject: |
|
|
hr = IDirectInputDevice_SetDataFormat(g_pMouse, &c_dfDIMouse2);
c_dfDIMouse2 <---- that is what makes > 4 mouse buttons works. |
|
Back to top |
|
|
BorisU
Joined: 08 Sep 2002
Posts: 128
Location: Moscow, Russia
|
Posted: Fri Jan 09, 2004 8:59 pm Post subject: |
|
|
I am new in DirectInput programming so I just tried to update code to use DirectInput7 API hoping that this would help Моst probably the critical change is that the fuh mentioned.
It seems that the changes requres that DirectInput version should be at least 7. I am not sure that it exists for NT4. |
|
Back to top |
|
|
Massa
Joined: 19 Sep 2002
Posts: 196
Location: Germany
|
Posted: Tue Jan 13, 2004 7:26 am Post subject: |
|
|
BorisU wrote: |
I am new in DirectInput programming so I just tried to update code to use DirectInput7 API hoping that this would help Моst probably the critical change is that the fuh mentioned. |
And I never did any DirectX programming.
So my experience is much lesser than yours
BorisU wrote: |
It seems that the changes requires that DirectInput version should be at least 7. I am not sure that it exists for NT4. |
No it does not.
NT4 is only able to handle DirectX 3 (as far as I remember this was the version before v7)
But I'm not sure if the Quake DirectInput code ever works with NT4?!
I integrated the code in FuhQuake (which was actually a 10 minutes job) and I'm able to use all my five MousButtons together with "-dinput"
I will test that version under NT4 later this week and keep you informed...
|
|
Back to top |
|
|
midn
Joined: 27 Sep 2003
Posts: 97
Location: Rio de Janeiro - Brasil
|
Posted: Tue Jan 13, 2004 2:46 pm Post subject: |
|
|
it's getting great results
cool
tkz again
_________________
E:\QUAKE\fuhquake-gl.exe -width 1280 -height 1024 -conwidth 512 -conheight 384 -mem 40 -bpp 32 +set cl_confirmquit 0 +set s_khz 44 -particles 512 -zone 8000 -dinput -m_smooth |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|