aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-27 19:31:19 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-27 19:31:19 +0000
commitd6fd80001bacd65e647a7971751a81859c2d887d (patch)
treee62d15533258f188af1360ce585f3ab1e44ed58b
parent812c2def5564f6aeb99fe6e593de6f7d21aa2a6a (diff)
fixed some minor bugs, should be ready to use; I added a [popup] to the help patch
svn path=/trunk/externals/hcs/; revision=9055
-rw-r--r--keyboard_layout-help.pd30
-rwxr-xr-xkeyboard_layout.c27
2 files changed, 25 insertions, 32 deletions
diff --git a/keyboard_layout-help.pd b/keyboard_layout-help.pd
index 6c07057..572f64c 100644
--- a/keyboard_layout-help.pd
+++ b/keyboard_layout-help.pd
@@ -1,10 +1,20 @@
-#N canvas 246 251 576 362 10;
-#X obj 206 158 keyboard_layout;
-#X obj 279 239 pddp/print;
-#X obj 92 247 pddp/print;
-#X msg 205 94 bang;
-#X msg 233 125 menu;
-#X connect 0 0 2 0;
-#X connect 0 1 1 0;
-#X connect 3 0 0 0;
-#X connect 4 0 0 0;
+..#N canvas 94 505 576 362 10;
+#X obj 116 144 keyboard_layout;
+#X msg 118 32 bang;
+#X msg 146 63 menu;
+#X obj 242 244 flatspace/popup 124 25 #ffffff language;
+#X msg 179 205 options;
+#X obj 179 182 route clear;
+#X symbolatom 116 277 0 0 0 0 - - -;
+#X text 185 64 see all options in the popup menu;
+#X obj 308 111 symbol;
+#X text 250 283 select a new input method with the popup menu;
+#X connect 0 0 6 0;
+#X connect 0 1 5 0;
+#X connect 1 0 0 0;
+#X connect 2 0 0 0;
+#X connect 3 1 8 0;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 5 1 3 0;
+#X connect 8 0 0 0;
diff --git a/keyboard_layout.c b/keyboard_layout.c
index 4c7c88e..54c6664 100755
--- a/keyboard_layout.c
+++ b/keyboard_layout.c
@@ -3,10 +3,10 @@
* ported to Pd by Hans-Christoph Steiner <hans@at.or.at> from f0.keyboard_layout.c
*/
-#ifdef __APPLE__
-
#include "m_pd.h"
+#ifdef __APPLE__
#include <Carbon/Carbon.h>
+#endif
static t_class *keyboard_layout_class;
@@ -16,22 +16,7 @@ typedef struct _keyboard_layout {
t_outlet* x_status_outlet;
} t_keyboard_layout;
-/*
-void keyboard_layout_assist(t_keyboard_layout *x, Object *m, long msg, long arg, char *dst) {
- if(msg==ASSIST_INLET) {
- sprintf(dst, "bang to get current, symbol to set");
- } else if(msg==ASSIST_OUTLET) {
- switch(arg) {
- case 0:
- sprintf(dst, "current keyboard layout (symbol)");
- break;
- case 1:
- sprintf(dst, "dump outlet (for menu)");
- break;
- }
- }
-}
-*/
+#ifdef __APPLE__
//----------------------------------------------------------------------------------------------
void keyboard_layout_bang(t_keyboard_layout *x) {
@@ -44,7 +29,7 @@ void keyboard_layout_bang(t_keyboard_layout *x) {
KLGetKeyboardLayoutProperty(currentLayoutRef, kKLName, (const void **)&keyboardName);
CFStringGetCString(keyboardName, cKeyboardName, 100, kCFStringEncodingASCII);
- outlet_anything(x->x_data_outlet, gensym(cKeyboardName), 0, NULL);
+ outlet_symbol(x->x_data_outlet, gensym(cKeyboardName));
}
void keyboard_layout_menu(t_keyboard_layout *x) {
@@ -108,10 +93,8 @@ void keyboard_layout_setup(void) {
class_addmethod(keyboard_layout_class, (t_method)keyboard_layout_menu,
gensym("menu"), 0);
-// class_addmethod(keyboard_layout_class, (t_method)keyboard_layout_assist,
-// gensym("assist"), A_CANT, 0);
- post("f0.keyboard_layout v1.1-ub; distributed under GNU GPL license"); //target specific
+ post("f0.keyboard_layout v1.1-ub; distributed under GNU GPL license");
}