Skip to content

Commit

Permalink
Allegro: make keyboards work.
Browse files Browse the repository at this point in the history
* This may come in useful.

Fixes http://ports.haiku-files.org/ticket/579.
  • Loading branch information
pulkomandy committed Nov 12, 2015
1 parent 9818548 commit edb4d73
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
2 changes: 1 addition & 1 deletion media-libs/allegro/allegro-4.4.2.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ HOMEPAGE="http://alleg.sourceforge.net/"
COPYRIGHT="1998-2010 Shawn Hargreaves et al."
LICENSE="Allegro"
REVISION="2"
SOURCE_URI="http://sourceforge.net/projects/alleg/files/allegro/4.4.2/allegro-4.4.2.tar.gz/download"
SOURCE_URI="http://sourceforge.net/projects/alleg/files/allegro/4.4.2/allegro-4.4.2.tar.gz"
CHECKSUM_SHA256="1b21e7577dbfada02d85ca4510bd22fedaa6ce76fde7f4838c7c1276eb840fdc"
PATCHES="allegro-4.4.2.patchset"

Expand Down
65 changes: 61 additions & 4 deletions media-libs/allegro/patches/allegro-4.4.2.patchset
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 77ba77a7ef990fe61c8e2f9674e6d61183660c08 Mon Sep 17 00:00:00 2001
From dd7f77dd640f2e3305f3af2e6a91c2b6dacfc632 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 30 Nov 2013 12:14:54 +0100
Subject: Import Allegro 4.4.1.1 fixes that were not upstreamed.
Expand Down Expand Up @@ -73,10 +73,10 @@ index c6e4dad..a7c9d46 100644
* not started from a terminal.
*/
--
1.8.3.4
2.2.2


From 3600b5bd60d00734b54c270485f63a97e1dbad18 Mon Sep 17 00:00:00 2001
From 6f2c9d6d41abe0588c25757fae58f5656b153709 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 25 Sep 2014 11:09:14 +0200
Subject: Hack install dirfor binaries.
Expand Down Expand Up @@ -118,5 +118,62 @@ index 170c3b4..572317e 100644

#-----------------------------------------------------------------------------#
--
1.8.3.4
2.2.2


From 55918d6a59c3bbf710303e41f7919915ea5b0777 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 12 Nov 2015 23:02:46 +0100
Subject: Remove useless check of the keyboard id

* Why not accept different keyboard types?

diff --git a/src/beos/bkeyapi.cpp b/src/beos/bkeyapi.cpp
index 302f353..74a672f 100644
--- a/src/beos/bkeyapi.cpp
+++ b/src/beos/bkeyapi.cpp
@@ -26,8 +26,6 @@
#error something is wrong with the makefile
#endif

-#define KEY_ID_PC101 0 // the docs say it should be 0x83ab, but they lie
-
#define KEY_SEMAPHORE_NAME "keyboard driver waiting..."

#define KEY_THREAD_PERIOD 33333 // microseconds, 1/30th of a second
@@ -44,8 +42,6 @@
#define PREFIX_W "al-bkey WARNING: "
#define PREFIX_E "al-bkey ERROR: "

-static uint16 keyboard_id = (uint16)(-1);
-
static volatile int keyboard_thread_running = FALSE;
static thread_id keyboard_thread_id = -1;

@@ -299,14 +295,6 @@ extern "C" int be_key_init(void)

_pckeys_init();

- if (get_keyboard_id(&keyboard_id) == B_ERROR) {
- goto cleanup;
- }
-
- if (keyboard_id != KEY_ID_PC101) {
- goto cleanup;
- }
-
waiting_for_input = create_sem(0, "waiting for input...");

if (waiting_for_input < B_NO_ERROR) {
@@ -363,8 +351,6 @@ extern "C" void be_key_exit(void)
delete_sem(waiting_for_input);
waiting_for_input = -1;
}
-
- keyboard_id = (uint16)(-1);
}


--
2.2.2

0 comments on commit edb4d73

Please sign in to comment.